Proposal: Merge Webpack configs
See original GitHub issueSorry if this was discussed before, I tried searching the issues and didn’t find any match. There are not so many differences between the webpack configs (dev / prod) and I have the working example (https://gist.github.com/emirotin/4ee74e426b20055e418a0101d754f8be) where they’re merged into a single factory. Then the entry configs just look like:
const getConfig = require('./webpack-config');
module.exports = getConfig(false);
If this is interesting I can send a PR.
Why is it useful? On a regular basis, I have to eject because I need TS support. This means at least adding a loader (same for dev and prod) and updating the list of extensions. Quite often I also want to play a bit with some plugins configuration and then need to replicate these changes in prod config.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
survivejs/webpack-merge: Merge designed for webpack
webpack -merge provides a merge function that concatenates arrays and merges objects creating a new object. If functions are encountered, it will execute...
Read more >Create Separate webpack Configs for Development and ...
In this lesson, we'll separate our webpack config into two configurations and update ... webpack Configs for Development and Production with webpack-merge.
Read more >Webpack Configuration | Merge - UXPin
UXPin's merge Docs, webpack configuration for new and advanced users. ... Merge relies on Webpack to bundle all of the component files.
Read more >How to combine Webpack 4 and Babel 7 to create a fantastic ...
We merge two configurations: one is our baseConfig and the other is prodConfiguration . The --env flags we pass in our scripts are...
Read more >How do you use webpack-merge and react? - Stack Overflow
I have been trying to make a webpack config for a react based app, it was working before I started using webpack-merge and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
TS is just an example, obv it can be CSS modules, or other modifications that apply to both dev and prod
Love to see this. We don’t want to maintain
ejected
things (really hard), but a flexible way to add some customize configurations.