Skip to content

Commit

Permalink
Update main readme: Explain env()
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Wermke committed Oct 13, 2016
1 parent 7f54a37 commit b6c2145
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ module.exports = createConfig([
])
```

### env()

You might wonder how `env('development', [ ... ])` works? Simple. It just checks the NODE_ENV environment variable and only applies its contained webpack blocks if it matches.

So make sure you set the NODE_ENV accordingly:

```js
// your package.json
"scripts": {
"build": "NODE_ENV=production webpack --config webpack.config.js",
"start": "NODE_ENV=development webpack-dev-server --config webpack.config.js"
}
```

If there is no NODE_ENV set then it will just treat NODE_ENV as if it was `development`.


## Available webpack blocks

Expand Down

0 comments on commit b6c2145

Please sign in to comment.