Use gulp-terser instead of webpack-terser (#5788)

This commit is contained in:
Paulus Schoutsen
2020-05-07 05:36:17 -07:00
committed by GitHub
parent 82741e490b
commit cf37ebb652
8 changed files with 97 additions and 15 deletions

View File

@@ -29,7 +29,7 @@ const createWebpackConfig = ({
}
return {
mode: isProdBuild ? "production" : "development",
devtool: isProdBuild ? "source-map" : "inline-cheap-module-source-map",
devtool: isProdBuild ? undefined : "inline-cheap-module-source-map",
entry,
module: {
rules: [
@@ -54,17 +54,18 @@ const createWebpackConfig = ({
},
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
extractComments: true,
sourceMap: true,
terserOptions: {
safari10: true,
ecma: latestBuild ? undefined : 5,
},
}),
],
// We minify in gulp. Only minify if we look at stats.
isStatsBuild &&
new TerserPlugin({
cache: true,
parallel: true,
extractComments: true,
terserOptions: {
safari10: true,
ecma: latestBuild ? undefined : 5,
},
}),
].filter(Boolean),
},
plugins: [
new ManifestPlugin(),