You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/webpack/v4/webpack.prod.config.js

47 lines
1.4 KiB

// NOTE: this configuration file MUST NOT be loaded with `-p` or `--optimize-minimize` option.
// This option includes an implicit call to UglifyJsPlugin and LoaderOptionsPlugin. Instead,
// an explicit call is made in this file to these plugins with customized options that enables
// more control of the output bundle in order to fix unexpected behavior in old browsers.
const webpack = require('webpack');
const merge = require('webpack-merge');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const baseConfig = require('./webpack.base.config.js');
module.exports = merge(baseConfig, {
mode: 'production',
plugins: [
new webpack.DefinePlugin({
__IN_DEV__: JSON.stringify(false),
__ENV__: JSON.stringify('prod')
})
],
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: false,
parallel: true,
sourceMap: true,
uglifyOptions: {
keep_fnames: true,
output: {
ascii_only: true,
beautify: false
}
}
}),
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
zindex: false,
reduceIdents: false,
autoprefixer: {
remove: false,
add: true,
browsers: ['> 1%']
}
}
})
]
}
});