Added process.env.NODE_ENV
to webpack.DefinePlugin
This commit is contained in:
parent
de5958752a
commit
60ec67c2a9
@ -1,3 +1,5 @@
|
|||||||
|
/* eslint global-require: 0 */
|
||||||
|
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@ -5,11 +7,11 @@ module.exports = {
|
|||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
|
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
|
||||||
loader: 'url-loader?limit=100000'
|
loader: 'url-loader?limit=100000',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.json$/,
|
test: /\.json$/,
|
||||||
loader: 'json-loader'
|
loader: 'json-loader',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.scss$/,
|
test: /\.scss$/,
|
||||||
@ -31,15 +33,21 @@ module.exports = {
|
|||||||
'transform-object-assign',
|
'transform-object-assign',
|
||||||
'transform-object-rest-spread',
|
'transform-object-rest-spread',
|
||||||
'lodash',
|
'lodash',
|
||||||
'react-hot-loader/babel'
|
'react-hot-loader/babel',
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
postcss: [
|
postcss: [
|
||||||
require('postcss-import')({ addDependencyTo: webpack }),
|
require('postcss-import')({ addDependencyTo: webpack }),
|
||||||
require('postcss-cssnext')
|
require('postcss-cssnext'),
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user