Combine all Webpack modes into single file

pull/6479/head
Thibaud Colas 2020-05-28 17:43:06 +01:00 zatwierdzone przez Karl Hobley
rodzic accdbd2174
commit d41df6ca46
3 zmienionych plików z 6 dodań i 53 usunięć

Wyświetl plik

@ -72,6 +72,12 @@ module.exports = function exports() {
// See https://webpack.js.org/configuration/devtool/.
devtool: 'source-map',
// For development mode only.
watchOptions: {
poll: 1000,
aggregateTimeout: 300,
},
stats: {
// Add chunk information (setting this to `false` allows for a less verbose output)
chunks: false,

Wyświetl plik

@ -1,23 +0,0 @@
var webpack = require('webpack');
var base = require('./base.config');
var config = base('development');
// development overrides go here
config.watch = true;
// add poll-options for in vagrant development
// See http://andrewhfarmer.com/webpack-watch-in-vagrant-docker/
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
};
// 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;

Wyświetl plik

@ -1,30 +0,0 @@
var webpack = require('webpack');
var base = require('./base.config');
var config = base('production');
// 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({
sourceMap: true,
compress: {
screw_ie8: true,
warnings: false
},
mangle: {
screw_ie8: true
},
output: {
comments: false,
screw_ie8: true
},
}));
module.exports = config;