Skip to content

Commit 1a88d7a

Browse files
committed
use terser-js-plugin to minify project built
1 parent c2bbc66 commit 1a88d7a

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

dist/addsearch-js-client.min.js

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/addsearch-js-client.min.js.LICENSE.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"node-fetch": "^2.6.7",
5555
"uglify-js": "^3.12.0",
5656
"webpack": "^5.72.0",
57-
"webpack-cli": "^3.3.12"
57+
"webpack-cli": "^3.3.12",
58+
"terser-webpack-plugin": "^5.3.1"
5859
}
5960
}

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const webpack = require('webpack');
22
const PACKAGE = require('./package.json');
33
const banner = PACKAGE.name + ' ' + PACKAGE.version;
44
const ESLintPlugin = require('eslint-webpack-plugin');
5+
const TerserJSPlugin = require('terser-webpack-plugin');
56

67
module.exports = {
78
entry: './src/index.js',
@@ -17,6 +18,11 @@ module.exports = {
1718
})
1819
],
1920
mode: 'production',
21+
optimization: {
22+
minimizer: [new TerserJSPlugin({
23+
extractComments: false,
24+
})]
25+
},
2026
module: {
2127
rules: [
2228
{

0 commit comments

Comments
 (0)