Skip to content

Commit 9ddfb21

Browse files
authored
Merge pull request #46 from aurelia/terser-no-compress
fix(webpack): bypass some terser bug
2 parents 3d0bb88 + 9ca010b commit 9ddfb21

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

webpack/webpack.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
33
const CopyWebpackPlugin = require('copy-webpack-plugin');
44
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
55
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
6+
const TerserPlugin = require('terser-webpack-plugin');
67
const project = require('./aurelia_project/aurelia.json');
78
const { AureliaPlugin } = require('aurelia-webpack-plugin');
89
// @if scaffold-navigation
@@ -90,6 +91,17 @@ module.exports = ({ production }, { analyze, hmr, port, host }) => ({
9091
chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[fullhash].chunk.js'
9192
},
9293
optimization: {
94+
minimizer: [
95+
new TerserPlugin({
96+
terserOptions: {
97+
// Terser fast minify mode
98+
// https://github.com/terser-js/terser#terser-fast-minify-mode
99+
// It's a good balance on size and speed to turn off compress.
100+
// Also bypass some terser bug.
101+
compress: false
102+
},
103+
}),
104+
],
93105
runtimeChunk: true, // separates the runtime chunk, required for long term cacheability
94106
// moduleIds is the replacement for HashedModuleIdsPlugin and NamedModulesPlugin deprecated in https://github.com/webpack/webpack/releases/tag/v4.16.0
95107
// changes module id's to use hashes be based on the relative path of the module, required for long term cacheability

0 commit comments

Comments
 (0)