Skip to content

Commit

Permalink
fix(webpack): bypass some terser bug
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Apr 28, 2024
1 parent 56d2814 commit 25c0437
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer');
const Dotenv = require('dotenv-webpack');
const TerserPlugin = require('terser-webpack-plugin');
// @if jasmine || mocha
const WebpackShellPluginNext = require('webpack-shell-plugin-next')
// @endif
Expand Down Expand Up @@ -60,6 +61,19 @@ module.exports = function(env, { /* @if jasmine || mocha*/runTest, /* @endif */a
// @endif
mode: production ? 'production' : 'development',
devtool: production ? undefined : 'eval-cheap-source-map',
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
// Terser fast minify mode
// https://github.com/terser-js/terser#terser-fast-minify-mode
// It's a good balance on size and speed to turn off compress.
// Also bypass some terser bug.
compress: false
},
}),
],
},
// @if jasmine || mocha
entry: {
entry: test ?
Expand Down

0 comments on commit 25c0437

Please sign in to comment.