Modified export to be a function which takes config