storybook-preset-craco icon indicating copy to clipboard operation
storybook-preset-craco copied to clipboard

Preset doesn't work if craco config is a function

Open sradevski opened this issue 3 years ago • 3 comments

It is possible for the default export from craco config to be a function, so you can do some calculations based on envvars, for example, but currently this preset will fail with "cracoConfig needs to be an object"

I think after https://github.com/artisanofcode/storybook-preset-craco/blob/fedf54a5f2b4c68635b67433f10bb79be2628289/index.js#L57 you can just add a check if it is a function, and if it is just run it.

sradevski avatar May 06 '21 14:05 sradevski