storybookjs / presets

🧩 Presets for Storybook
MIT License
424 stars 104 forks source link

preset-create-react-app - make sure to always return valid rule #211

Closed martinerko closed 1 year ago

martinerko commented 3 years ago

As per Webpack spec, providing include/exclude parameter when defining rule is not mandatory. When using preset-create-react-app with default CRA setup, everything works fine. However, for people using customized CRA (such as craco, react-app-rewired) this can cause an issue if the rule that gets modified as part of this preset does not contain such a parameter (include/exclude). Preset will produce an array containing an undefined value in it which will later cause a crash.

image

Such a rule has been already introduced to CRA codebase but has not been released yet.

ndelangen commented 1 year ago

@martinerko I'm closing this PR because of inactivity. I'd have possibly merged if it was fully working, but as @sventschui mentioned there';'s a problem with this code as-is.

We don't support things like craco, react-app-rewired etc...