Skip to content

Commit f7850dd

Browse files
committed
Merge pull request facebook#5686 from vitorbal/master
Improve documentation for using React with Webpack
2 parents 67e85df + a3d6553 commit f7850dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/docs/getting-started.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ $ npm install --save react react-dom babelify babel-preset-react
3434
$ browserify -t [ babelify --presets [ react ] ] main.js -o bundle.js
3535
```
3636

37-
To install React DOM and build your bundle with webpack:
37+
To install React DOM and build your bundle with webpack:
3838

3939
```sh
4040
$ npm install --save react react-dom babel-preset-react
@@ -45,6 +45,15 @@ $ webpack
4545
>
4646
> If you are using ES2015, you will want to also use the `babel-preset-es2015` package.
4747
48+
**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:
49+
50+
```js
51+
new webpack.DefinePlugin({
52+
"process.env": {
53+
NODE_ENV: JSON.stringify("production")
54+
}
55+
});
56+
```
4857

4958
## Quick Start Without npm
5059

0 commit comments

Comments
 (0)