question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: Merge Webpack configs

See original GitHub issue

Sorry 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
emirotincommented, Jun 20, 2017

TS is just an example, obv it can be CSS modules, or other modifications that apply to both dev and prod

1reaction
vinhlhcommented, Jul 25, 2017

Love to see this. We don’t want to maintain ejected things (really hard), but a flexible way to add some customize configurations.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found