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

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^3.3.1",
"@cloudflare/wrangler": "^1.19.7",
"terser-webpack-plugin": "^4.2.3",
"ts-loader": "^8.3.0",
"typescript": "^4.5.5",
"url-loader": "^4.1.1",

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