Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Define process.env.NODE_ENV for React #3487

Merged
merged 1 commit into from
Jan 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ var buildConfigs = languages.map(function (lang) {
extensions: ["", ".js", ".jsx", ".json", ".less"]
},
plugins: [
// This passes __PG_DEBUG__ variable to the bundle
new webpack.DefinePlugin({
__PG_DEBUG__: devMode
// This passes __PG_DEBUG__ variable to the bundle
__PG_DEBUG__: devMode,
// React uses this to enable production mode
"process.env": {
NODE_ENV: devMode ? "\"development\"" : "\"production\""
}
}),
new WebpackNotifierPlugin({ alwaysNotify: true })
],
Expand Down