-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Make Webpack Upgradable and DRY #453
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Made a more generic `webpack.make.config.js` file that includes all the instructions on how to build the project with both production and development. The `webpack.config.js` and the `webpack.prod.config.js` files are not requiring the new make file and passing in some arguments (in this case just an option called `PRODUCTION`). Based on these arguments the make file will change how it returns the config object. using this method you don't need to edit two files when you add a loader, or change a plugin. They are using the same configuration file and that makes it much more DRY!
# Conflicts: # webpack.config.js # webpack.prod.config.js
Spittal
changed the title
Make webpack more upgradable and Dry
Make Webpack Upgradable and DRY
Mar 21, 2016
this is fine having a common/base/default config but only if we create a new copy var defaultConfig = require('webpack.defaults.js');
module.exports = webpackMerge(defaultConfig, {
devtool: 'eval'
}); that's more familiar to new webpack devs |
+1 |
…pack-starter # Conflicts: # config/webpack.dev.js
Hey @gdi2290 I was able to refactor using webpack merge. Tested with |
+1 |
…pack-starter # Conflicts: # config/webpack.dev.js # config/webpack.prod.js
thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The webpack configuration has been changed so that components of the configuration that is shared between production and development are now in one file. It makes the files more cohesive and easier to update.
I've tried introducing this before, but was rejected on grounds of complexity. I would like to argue that this configuration is yes slightly more complex (not anymore complex than other parts of this starter pack) but makes it much easier to to merge in changes from this repo into existing projects. Not only does it allow you put your custom loaders in a single file, but also the "config" object having the ability to be passed around means that you can merge changes from this repo much easier without breaking some "application specific" changes.
There is a lots of duplicate code in the webpack configurations.
Made the webpack conmfiguration more dry, and more scalable.
I've been trying to stay up to date with the latest polyfills, and beta versions of Angular while developing an application, It's important to me that I am able to quickly apply changes made in this repo to my own applications. This PR would make that process much faster for me.