Skip to content
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

Should list of node packages to transpile be whitelisted for performance? #2465

Closed
justin808 opened this issue Feb 15, 2020 · 3 comments
Closed

Comments

@justin808
Copy link
Contributor

Has anybody checked if Babel transpiling almost all packages in node_modules slows compilation times significantly?

I just noticed that the default config has a loader that compiles almost all of node_modules:

https://github.com/rails/webpacker/blob/master/package/rules/node_modules.js

  include: /node_modules/,
  exclude: /(?:@?babel(?:\/|\\{1,2}|-).+)|regenerator-runtime|core-js|^webpack$|^webpack-assets-manifest$|^webpack-cli$|^webpack-sources$|^@rails\/webpacker$/,

I see that a few packages are excluded.

Would it be preferable to have some configuration, maybe in config/webpacker.yml that white lists the packages to transpile?

@jakeNiemiec
Copy link
Member

@justin808 First off, please see a wider discussion on this here: #2131 (comment)

Has anybody checked if Babel transpiling almost all packages in node_modules slows compilation times significantly?

Not only is it slower, it causes stack overflows and out of memory issues for many users. Again, see the issue above.

@nicospz
Copy link

nicospz commented Mar 6, 2020

Something like are-you-es5 can help you check what files need transpilation, then you include them using the regex string it generates
/node_modules/(?![plugin-1|plugin-2])/

@justin808
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants