Improve documentation for using React with Webpack

Fixes #5679
This commit is contained in:
Vitor Balocco
2015-12-17 17:22:56 +01:00
parent 0b6203c305
commit 66170a94d5

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