-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
More webpack config updates #1546
Conversation
I would get rid of the callback, and make split_chunks an option in webpacker.yml. If users want to fine-tune webpack's config.optimization settings, then let them do that directly by setting Exposing more of this gem/package's internal configuration API to the user seems like the wrong direction to me. |
Babel config should be moved to The new You could also move the browserlist config to a dedicated file or |
@edslocomb Webpacker.yml is intended for configs that are common to both JS package and Ruby Gem - things like paths or extensions. Anything that's related to Webpack can be overridden from environment.js or a specific environment file. |
Thanks @renchap Yep, been looking into some of these changes. Makes sense to move this to JS to have more control. In regards to
This is already addressed in e25b73b |
1edd61e
to
2b57ac9
Compare
Moved out babel changes to #1564 |
2b57ac9
to
314db5a
Compare
314db5a
to
6e8a180
Compare
@gauravtiwari I'm not sure I understand the reasoning behind that distinction. Surely any option controlling the build, whether it is a pathname or a feature toggle, is a concern of both Webpack and also of the gem that manages Webpack? I can imagine a user who knows little to nothing about Webpack's config, and wants to keep it that way, using webpacker.yml to toggle a plugin on or off here and there instead of learning Webpack's config syntax. And I can imagine a user who knows a fair bit about Webpack's config options and config file structure, who wants to alter that file structure directly. What I can't imagine is a user who wants to learn a third configuration API in addition to those two when trying to get a particular Webpack feature to work through Webpacker. |
@edslocomb Agreed, a third configuration API makes no sense, the webpack config should be available for the user to modify easily at will: #1556. The value in webpacker is in preconfiguring loaders that most apps will require, as well as handling the different release stages as defined in Rails, with helpful tweaks here and there (like the @gauravtiwari Trying to reimplement what is already provided in |
In line with Webpack 4 changes, this PR adds support for: split chunking and webpack config updates
A separate rule to compile node modules (fixes cases where ES6 libraries were included in the app code)
More config updates and tidying up