Skip to content

Commit

Permalink
docs(globals): Clarify webpackDefine-plugin globals must be added to …
Browse files Browse the repository at this point in the history
….eslintrc when adding to config/_base.js.

- Update README globals section.
  • Loading branch information
Wayne K. Walrath authored and David Zukowski committed Jan 17, 2016
1 parent ee58251 commit f65e37b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,14 @@ import SomeComponent from 'components/SomeComponent' // Hooray!

### Globals

These are global variables available to you anywhere in your source code. If you wish to modify them, they can be found as the `globals` key in `~/config/index.js`.
These are global variables available to you anywhere in your source code. If you wish to modify them, they can be found as the `globals` key in `~/config/_base.js`. When adding new globals, also add them to `~/.eslintrc`.

* `process.env.NODE_ENV` - the active `NODE_ENV` when the build started
* `__DEV__` - True when `process.env.NODE_ENV` is `development`
* `__PROD__` - True when `process.env.NODE_ENV` is `production`
* `__TEST__` - True when `process.env.NODE_ENV` is `test`
* `__DEBUG__` - True when `process.env.NODE_ENV` is `development` and cli arg `--no_debug` is not set (`npm run dev:no-debug`)
* `__BASENAME__` - [npm history basename option](https://github.com/rackt/history/blob/master/docs/BasenameSupport.md)

Server
------
Expand Down
1 change: 1 addition & 0 deletions config/_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Edit at Your Own Risk
// ------------------------------------
// Environment
// ------------------------------------
// N.B.: globals added here must _also_ be added to .eslintrc
config.globals = {
'process.env' : {
'NODE_ENV' : JSON.stringify(config.env)
Expand Down

0 comments on commit f65e37b

Please sign in to comment.