Skip to content

Commit 0661074

Browse files
committed
Allow access to the NODE_ENV for writing development-only code
1 parent 24ec1e5 commit 0661074

4 files changed

+12
-6
lines changed

webpack.config.demo.babel.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ module.exports = {
1818
inject: true,
1919
template: './src/examples/basicExample/index.html',
2020
}),
21-
new webpack.DefinePlugin({
22-
'process.env': {
23-
'NODE_ENV': JSON.stringify('production'),
24-
'BABEL_ENV': JSON.stringify('production')
25-
},
26-
}),
21+
new webpack.EnvironmentPlugin([
22+
"NODE_ENV",
23+
]),
2724
new webpack.optimize.UglifyJsPlugin({
2825
compress: {
2926
warnings: false

webpack.config.dev.babel.js

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = {
1818
inject: true,
1919
template: './src/examples/basicExample/index.html'
2020
}),
21+
new webpack.EnvironmentPlugin([
22+
"NODE_ENV",
23+
]),
2124
new webpack.NoErrorsPlugin(),
2225
],
2326
postcss: [

webpack.config.test.babel.js

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ module.exports = {
1818
inject: true,
1919
template: './src/examples/basicExample/index.html'
2020
}),
21+
new webpack.EnvironmentPlugin([
22+
"NODE_ENV",
23+
]),
2124
],
2225
postcss: [
2326
autoprefixer,

webpack.config.umd.babel.js

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ module.exports = {
2828
},
2929
devtool: 'source-map',
3030
plugins: [
31+
new webpack.EnvironmentPlugin([
32+
"NODE_ENV",
33+
]),
3134
new webpack.optimize.OccurenceOrderPlugin(),
3235
new webpack.optimize.UglifyJsPlugin({
3336
compress: {

0 commit comments

Comments
 (0)