From dee4ea8e850af2b54f00ff5eeb115d2efc7388c1 Mon Sep 17 00:00:00 2001 From: Redian Date: Wed, 5 Apr 2017 14:28:43 +0100 Subject: [PATCH] Update production-build.md The comment was implying that a switch-case exists. Checking the history, the switch-case was phased out on this commit: {7b83c190339395ee8d9a944e91d017b1ce03df5e} --- content/guides/production-build.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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.