Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Best practice for webpack.config.js? #264

Open
bazzel opened this issue Apr 13, 2019 · 1 comment
Open

Best practice for webpack.config.js? #264

bazzel opened this issue Apr 13, 2019 · 1 comment
Labels

Comments

@bazzel
Copy link
Member

bazzel commented Apr 13, 2019

On the web I see different approaches how to deal with settings that depend on the environment (dev, prod) the application is running in. Some use 1 webpack.config.js and use if statements to apply the proper settings, others define common settings in webpack.config.js, define env. specific ones in i.e. webpack.dev.jsand merge these into webpack.config.js (the exact application may vary).

Maji uses the if variant, but I'm wondering what's the reason behind this?
Of course this may be historical, but it looks like the webpack docs use the latter one.

@pascalw
Copy link
Member

pascalw commented Apr 17, 2019

I don't have a real strong opinion on this, but I slightly prefer having everything in 1 file as long as there are not too many conditions / differences between environments.

I've seen Webpack configurations that were split up in a handful of files, which IMO makes it pretty hard to grasp what the configuration as a whole is doing.

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

No branches or pull requests

2 participants