Add a note about production mode for npm installs.

This commit is contained in:
Christopher Monsanto
2014-07-05 20:52:42 -04:00
parent e10d10e31e
commit 9ddb4d4a78
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -76,6 +76,8 @@ React.renderComponent(...);
If you'd like to use any [add-ons](/react/docs/addons.html), use `var React = require('react/addons');` instead.
**Note:** by default, React will be in development mode. To use React in production mode, set the environment variable `NODE_ENV` to `production`. For use in node, this is sufficient; if you are using browserify, the [envify](https://github.com/hughsk/envify) transform is needed to make use of environment variables. A minifier that performs dead-code elimination such as [UglifyJS](https://github.com/mishoo/UglifyJS2) is recommended to completely remove the extra code present in development mode.
## Bower
```sh
+3
View File
@@ -5,6 +5,9 @@ without also requiring the JSX transformer. This is especially useful for cases
want to [`browserify`](https://github.com/substack/node-browserify) your module using
`React`.
**Note:** by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages.
To use React in production mode, set the environment variable `NODE_ENV` to `production`. For use in node, this is sufficient; if you are using browserify, the [envify](https://github.com/hughsk/envify) transform is needed to make use of environment variables. A minifier that performs dead-code elimination such as [UglifyJS](https://github.com/mishoo/UglifyJS2) is recommended to completely remove the extra code present in development mode.
## Example Usage