Skip to content

Commit

Permalink
Configure webpack terser
Browse files Browse the repository at this point in the history
  • Loading branch information
golopot committed Apr 16, 2022
1 parent 2caf709 commit afb1487
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
17 changes: 16 additions & 1 deletion extension/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const CopyWebpackPlugin = require('copy-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const WebpackPrettierPlugin = require('webpack-prettier-plugin');

module.exports = {
entry: './main.js',
Expand All @@ -11,6 +13,19 @@ module.exports = {
new CopyWebpackPlugin({
patterns: [{from: 'public'}],
}),
new WebpackPrettierPlugin(),
],
mode: 'production',
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
ecma: 2018,
compress: false,
mangle: false,
},
}),
],
},
mode: 'none',
};
17 changes: 15 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
"copy-webpack-plugin": "^10.2.0",
"eslint": "^8.6.0",
"jest": "^27.5.1",
"prettier": "^2.5.1",
"prettier": "^2.6.2",
"typescript": "^4.5.4",
"webpack": "^5.66.0",
"webpack-cli": "^4.9.1"
"webpack-cli": "^4.9.1",
"webpack-prettier-plugin": "^1.0.3"
},
"engines": {
"node": ">=14.5.0"
Expand Down

0 comments on commit afb1487

Please sign in to comment.