diff --git a/docs/getting-started.md b/docs/getting-started.md index 5a388495..d9e44318 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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