Application Environment Configuration with webpack — Matt McLaugh

  • /src/config/dev.js to config, you can call import config from ‘config’ throughout your application.
  • ‘s an example of the development webpack config from my front-end-template repo
  • Webpack is very robust, and we can achieve environment configuration with no extra plugins.
  • With the method you don’t have to rely on global variables, you can comment your config files (they’re just javascript) and change the alias location of config for each webpack environment configuration file.
  • When configuring webpack, I prefer to keep separate config files for each environment.

Read the full article, click here.


@mattmclaugh: “I just published “Application Environment Configuration with webpack” #webpack #javascript #reactjs #webdev”


Out of the box, webpack doesn’t come with a clear path to environment configuration (please correct me if I’m wrong) If you want to use a…


Application Environment Configuration with webpack — Matt McLaugh