artisanofcode-archive / storybook-preset-craco

Craco preset for Storybook
MIT License
33 stars 12 forks source link

Preset doesn't work if craco config is a function #6

Open sradevski opened 3 years ago

sradevski commented 3 years ago

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.

danielknell commented 3 years ago

I will try to look at this some time next week unless someone wants to PR it first.

ArtemFokin commented 2 years ago

Still not working

DoWhileGeek commented 2 years ago

I'm getting bit by this as well