-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default webpack excludes .jsx files in 'node_modules' from being compiled by Webpack #1119
Comments
Really good question! I would like to ask more webpack experts on this matter. |
Definitely NOT a webpack expert, but I would be concerned about the performance implications of this change. Have noticed (I think! Have not tested rigorously!) increased build times when I remove excludePaths, etc. So we would probably want to make sure that's not the case before loosening anything up. |
Iirc according to webpack it is a bad idea to include node_modules to the compilation (as shilman said because of performance and compilation time issues). Users should manually include those node modules that they want to be compiled. |
I'm gonna close this issue since I think it's better to leave as is than to remove the excluded |
If I have a set of JSX modules in an npm package and I want to import them to use in a story, I get an error that says I need the appropriate loader. In our default webpack config, we exclude
node_modules
from our JSX loader.https://github.com/storybooks/storybook/blob/master/app/react/src/server/config/webpack.config.js#L37
https://github.com/storybooks/storybook/blob/master/app/react/src/server/config/utils.js#L5
Most component modules like Airbnb's React Datepicker actually transpile to ES5 when exporting to CommonJS so both the original JSX and the ES5 version are available. If we import the transpiled ES5 file, we lose the ability to use react-docgen to provide automatic documentation generation.
The question is, should I just reconfigure the loader on my end or is it beneficial if I remove the excludePaths from
.jsx
in our default config in our codebase?The text was updated successfully, but these errors were encountered: