Skip to content

Commit 324de5d

Browse files
committed
envify react in production
Made the mistake to include the development build of react in the production build. Fixed by setting process.env manually to production in makewebpackconfig.js Thx to @gaearon for https://twitter.com/dan_abramov/status/592692202335301636
1 parent 0b58ddb commit 324de5d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

makewebpackconfig.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ module.exports = function(options) {
3737
},
3838
inject: true // inject all files that are generated by webpack, e.g. bundle.js, main.css with the correct HTML tags
3939
}),
40-
new ExtractTextPlugin("css/main.css")
40+
new ExtractTextPlugin("css/main.css"),
41+
new webpack.DefinePlugin({
42+
"process.env": {
43+
NODE_ENV: JSON.stringify("production")
44+
}
45+
})
4146
];
4247

4348
// If app is in development

0 commit comments

Comments
 (0)