Skip to content

Commit

Permalink
feat: 优化构建压缩配置
Browse files Browse the repository at this point in the history
  • Loading branch information
slatejack committed Feb 6, 2024
1 parent d9717d5 commit c72b588
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ module.exports = {
devtool: isDev ? 'eval-cheap-source-map' : 'hidden-source-map',
// devtool: 'eval-cheap-source-map',
optimization: {
minimize: !isDev,
minimizer: [
new TerserPlugin({
test: /\.ts[x]?$/,
parallel: 4,
minify: TerserPlugin.swcMinify,
terserOptions: {
compress: {
ecma: 5,
drop_console: !isDev,
},
},
}),
]
],
},
output: {
path: resolve('../dist/'),
Expand Down

0 comments on commit c72b588

Please sign in to comment.