Skip to content
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

Document how to specify environment in config #823

Merged
merged 1 commit into from Feb 6, 2017
Merged

Conversation

simon04
Copy link
Collaborator

@simon04 simon04 commented Feb 4, 2017

  • Using --env
  • Using environment variables

Fixes #790.

- simon04
---

Eventually. you will find the need to disambiguate in your `webpack.config.js` between [development](/guides/development) and [production builds](/guides/production-build). You have (at least) two options:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra . at the beginning.

* Using `--env`
* Using environment variables
@simon04
Copy link
Collaborator Author

simon04 commented Feb 6, 2017

Thanks. Fixed.

@bebraw bebraw merged commit 5f79561 into webpack:master Feb 6, 2017
@simon04
Copy link
Collaborator Author

simon04 commented Feb 15, 2017

Relates to #401.

+module.exports = function(env) {
+ return {
plugins: [
new webpack.optimize.UglifyJsPlugin({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, why does this need to be in Uglify?

    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify('production')
    })

This way is referenced in https://github.com/webpack/webpack.js.org/blob/master/content/guides/production.md#node-environment-variable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants