Skip to content

Update production-build.md (#1) #1078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions content/guides/production-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ contributors:
- chrisVillanueva
- swapnilmishra
- bring2dip
- redian
---

This page explains how to generate production builds with webpack.
Expand Down Expand Up @@ -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.
Expand Down