diff --git a/content/guides/production-build.md b/content/guides/production-build.md index 457c0b4bbcdf..9674e8fc6fe3 100644 --- a/content/guides/production-build.md +++ b/content/guides/production-build.md @@ -10,6 +10,7 @@ contributors: - chrisVillanueva - swapnilmishra - bring2dip + - redian --- This page explains how to generate production builds with webpack. @@ -144,8 +145,8 @@ And from our package.json, where we build our application using webpack, the com "build:dist": "webpack --env=prod --progress --profile --colors", ``` -You could see that we passed the environment variable to our webpack.config.js file. From there we used a simple -switch-case to build for the environment we passed by simply loading the right js file. +You can see that we passed the environment variable to our webpack.config.js file. +The environment variable is then passed to `buildConfig` method which simply loads the right js file for the build. An advanced approach would be to have a base configuration file, put in all common functionalities, and then have environment specific files and simply use 'webpack-merge' to merge them. This would help to avoid code repetitions.