kabisa / maji

Maji is a framework to build great hybrid mobile apps.
https://www.majimobile.com/
MIT License
18 stars 10 forks source link

Best practice for webpack.config.js? #264

Open bazzel opened 5 years ago

bazzel commented 5 years ago

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 commented 5 years ago

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.