Added terser-webpack-plugin

This commit is contained in:
Alexander Cerutti
2022-02-03 22:01:19 +01:00
parent 788c400850
commit c7b4105ae9
3 changed files with 1089 additions and 301 deletions

View File

@@ -1,4 +1,5 @@
const path = require("path");
const TerserPlugin = require("terser-webpack-plugin");
/**
* @see https://developers.cloudflare.com/workers/cli-wrangler/webpack
@@ -9,6 +10,22 @@ module.exports = {
entry: "./src/index.ts",
target: "webworker",
/** Adding more minifization (for what it can apply... ) */
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
}),
],
},
/**
* "development" mode does not support the usage of eval
* @see https://github.com/cloudflare/wrangler/issues/1268