kopia lustrzana https://github.com/wagtail/wagtail
Refine webpack configuration per env
Add env-specific webpack configuration Add basic env-specific webpack configuration Use more advanced production uglify config Simplify webpack loader configpull/3300/head
rodzic
e18c1d99c8
commit
87b400d00b
|
@ -54,13 +54,9 @@ module.exports = function exports() {
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.(js|jsx)$/,
|
||||||
loader: 'babel'
|
loader: 'babel'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
test: /\.jsx$/,
|
|
||||||
loader: 'babel'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
var webpack = require('webpack');
|
||||||
var base = require('./webpack.base.config');
|
var base = require('./webpack.base.config');
|
||||||
var config = base('development');
|
var config = base('development');
|
||||||
|
|
||||||
|
@ -7,4 +8,11 @@ config.watch = true;
|
||||||
// See http://webpack.github.io/docs/configuration.html#devtool
|
// See http://webpack.github.io/docs/configuration.html#devtool
|
||||||
config.devtool = 'inline-source-map';
|
config.devtool = 'inline-source-map';
|
||||||
|
|
||||||
|
// Set process.env.NODE_ENV to development to enable JS development aids.
|
||||||
|
config.plugins.push(new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
NODE_ENV: JSON.stringify('development'),
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
|
@ -1,8 +1,28 @@
|
||||||
|
var webpack = require('webpack');
|
||||||
var base = require('./webpack.base.config');
|
var base = require('./webpack.base.config');
|
||||||
var config = base('production');
|
var config = base('production');
|
||||||
|
|
||||||
|
|
||||||
// production overrides go here
|
// production overrides go here
|
||||||
|
config.plugins.push(new webpack.DefinePlugin({
|
||||||
|
'process.env': {
|
||||||
|
NODE_ENV: JSON.stringify('production'),
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
// See https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/config/webpack.config.prod.js.
|
||||||
|
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
|
||||||
|
compress: {
|
||||||
|
screw_ie8: true,
|
||||||
|
warnings: false
|
||||||
|
},
|
||||||
|
mangle: {
|
||||||
|
screw_ie8: true
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
comments: false,
|
||||||
|
screw_ie8: true
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
Ładowanie…
Reference in New Issue