Version: 1.1.01.1.11.1.21.1.31.2.01.2.11.2.21.3.01.3.21.3.31.4.01.4.11.4.21.4.31.4.41.4.5-rc1.5.01.5.11.5.21.5.41.5.5-rc1.5.51.5.7-rc1.5.71.5.8-rc1.5.8-rc11.5.81.5.9-rc1.5.9-rc21.6.0-rc1.6.0-rc11.6.01.6.1-pwa1.6.1-pwa11.6.11.6.21.7.0-rc1.7.0-rc-wasm1.7.0-rc11.7.0-rc21.7.01.7.11.7.2-beta1.7.2-beta.11.7.2-beta.21.7.2-beta.31.7.21.7.31.7.41.7.51.7.6-hy1.7.6-hy.11.7.6-hy.21.7.6-hy.41.7.6-hy.51.7.6-hy.61.7.6-hy.71.7.6-hy.81.7.6-hy.91.7.6-hy.101.7.6-hy.111.7.6-hy.121.7.6-rc1.7.6-rc.11.7.71.7.81.7.91.7.101.8.01.8.11.8.2-rc1.8.21.8.3-beta1.8.31.8.41.8.5-01.9.01.9.1-01.9.1-rc1.9.1-rc.11.9.2-01.9.21.9.3-01.9.41.9.51.9.61.10.01.10.11.10.21.10.31.10.41.10.5-01.10.51.10.7-01.10.71.10.81.10.9-01.10.9-rc.11.11.01.11.31.11.4-rc.11.11.4-rc.21.11.4-rc.31.11.4-rc.41.11.4-rc.51.11.4-rc.61.12.01.12.1-rc1.12.1-rc.11.12.11.12.2-rc1.12.2-rc.11.12.21.12.3-rc1.12.31.12.4-rc1.12.4-rc.11.12.4-rc.21.12.41.12.51.12.61.12.71.12.8-01.12.8-11.12.81.13.01.14.0-beta1.14.01.14.1-beta1.14.11.14.2-beta1.14.31.15.01.15.11.15.21.15.31.15.41.16.0-mc1.16.01.16.11.16.21.16.31.17.01.17.11.17.21.18.01.19.0-11.20.01.20.11.20.2-t.01.20.21.20.31.20.41.20.51.20.61.21.01.21.11.21.22.0.0-beta.0
module.exports = options => ({
uglifyOptions: {
// 强制使用 es5 压缩输出,避免 es6 优化导致兼容性问题
ecma: 5,
compress: {
collapse_vars: false, // 0.3kb
// Disabled because of an issue with Uglify breaking seemingly valid code:
// https://github.com/facebook/create-react-app/issues/2376
// Pending further investigation:
// https://github.com/mishoo/UglifyJS2/issues/2011
comparisons: false,
computed_props: false,
hoist_funs: false,
hoist_props: false,
inline: false,
loops: false,
negate_iife: false,
properties: false,
reduce_funcs: false,
reduce_vars: false,
// a few flags with noticable gains/speed ratio
// numbers based on out of the box vendor bundle
booleans: true, // 0.7kb
sequences: true, // 0.7kb
// required features to drop conditional branches
conditionals: true,
drop_console: options.console
},
mangle: {
safari10: true
output: {
// Turned on because emoji and regex is not minified properly using default
// https://github.com/facebook/create-react-app/issues/2488
ascii_only: true
}
sourceMap: options.sourceMap,
cache: true,
parallel: true
})