Merge pull request #5686 from vitorbal/master

Improve documentation for using React with Webpack
This commit is contained in:
Paul O’Shannessy 2016-01-11 12:25:26 -08:00
commit f7850dd3d7
1 changed files with 10 additions and 1 deletions

View File

@ -34,7 +34,7 @@ $ npm install --save react react-dom babelify babel-preset-react
$ browserify -t [ babelify --presets [ react ] ] main.js -o bundle.js
```
To install React DOM and build your bundle with webpack:
To install React DOM and build your bundle with webpack:
```sh
$ npm install --save react react-dom babel-preset-react
@ -45,6 +45,15 @@ $ webpack
>
> If you are using ES2015, you will want to also use the `babel-preset-es2015` package.
**Note:** by default, React will be in development mode, which is slower, and not advised for production. To use React in production mode, set the environment variable `NODE_ENV` to `production` (using envify or webpack's DefinePlugin). For example:
```js
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: JSON.stringify("production")
}
});
```
## Quick Start Without npm