From 0a7cc949391d164db215efadd1b654fcabb6d9ff Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 26 Aug 2021 07:16:47 +0300 Subject: [PATCH] feat: added built-in typescript types --- README.md | 53 ++- package-lock.json | 381 ++++++++++-------- package.json | 13 +- src/index.js | 144 +++---- src/minify.js | 9 +- src/options.json | 2 +- src/utils.js | 19 +- test/__snapshots__/TerserPlugin.test.js.snap | 6 +- .../extractComments-option.test.js.snap | 52 +-- test/__snapshots__/minify-option.test.js.snap | 2 +- test/__snapshots__/test-option.test.js.snap | 64 +-- .../validate-options.test.js.snap | 2 +- types/cjs.d.ts | 3 + types/index.d.ts | 300 ++++++++++++++ types/minify.d.ts | 15 + types/utils.d.ts | 115 ++++++ 16 files changed, 839 insertions(+), 341 deletions(-) create mode 100644 types/cjs.d.ts create mode 100644 types/index.d.ts create mode 100644 types/minify.d.ts create mode 100644 types/utils.d.ts diff --git a/README.md b/README.md index c6b7c9b..d350a32 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,9 @@ Using supported `devtool` values enable source map generation. | :---------------------------------------: | :-----------------------------------------------------------------------------: | :-------------------------------------------------------------: | :--------------------------------------------------------------------------- | | **[`test`](#test)** | `String\|RegExp\|Array` | `/\.m?js(\?.*)?$/i` | Test to match files against. | | **[`include`](#include)** | `String\|RegExp\|Array` | `undefined` | Files to include. | -| **[`exclude`](#)** | `String\|RegExp\|Array` | `undefined` | Files to exclude. | +| **[`exclude`](#exclude)** | `String\|RegExp\|Array` | `undefined` | Files to exclude. | | **[`parallel`](#parallel)** | `Boolean\|Number` | `true` | Use multi-process parallel running to improve the build speed. | -| **[`minify`](#minify)** | `Function` | `undefined` | Allows you to override default minify function. | +| **[`minify`](#minify)** | `Function` | `TerserPlugin.terserMinify` | Allows you to override default minify function. | | **[`terserOptions`](#terseroptions)** | `Object` | [`default`](https://github.com/terser-js/terser#minify-options) | Terser [minify options](https://github.com/terser-js/terser#minify-options). | | **[`extractComments`](#extractcomments)** | `Boolean\|String\|RegExp\|Function<(node, comment) -> Boolean\|Object>\|Object` | `true` | Whether comments shall be extracted to a separate file. | @@ -185,7 +185,7 @@ module.exports = { ### `minify` Type: `Function` -Default: `undefined` +Default: `TerserPlugin.terserMinify` Allows you to override default minify function. By default plugin uses [terser](https://github.com/terser-js/terser) package. @@ -637,6 +637,53 @@ module.exports = { }; ``` +### Typescript + +With default terser minify function: + +```ts +module.exports = { + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + terserOptions: { + compress: true, + }, + }), + ], + }, +}; +``` + +With built-in minify functions: + +```ts +import type { SwcMinifyFunction } from "terser-webpack-plugin"; + +module.exports = { + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + minify: TerserPlugin.swcMinify, + terserOptions: { + compress: true, + }, + }), + + // Alternative: + new TerserPlugin({ + minify: TerserPlugin.swcMinify, + terserOptions: { + compress: true, + }, + }), + ], + }, +}; +``` + ## Contributing Please take a moment to read our contributing guidelines if you haven't yet done so. diff --git a/package-lock.json b/package-lock.json index 498bc74..b7ab537 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^5.7.1" + "terser": "^5.7.2" }, "devDependencies": { "@babel/cli": "^7.14.8", @@ -21,7 +21,7 @@ "@babel/preset-env": "^7.14.9", "@commitlint/cli": "^13.1.0", "@commitlint/config-conventional": "^13.1.0", - "@swc/core": "^1.2.78", + "@swc/core": "^1.2.82", "@types/serialize-javascript": "^5.0.1", "@types/uglify-js": "^3.13.1", "@webpack-contrib/eslint-config-webpack": "^3.0.0", @@ -30,12 +30,12 @@ "cross-env": "^7.0.3", "del": "^6.0.0", "del-cli": "^3.0.1", - "esbuild": "^0.12.20", + "esbuild": "^0.12.23", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.22.1", + "eslint-plugin-import": "^2.24.2", "file-loader": "^6.2.0", - "husky": "^7.0.0", + "husky": "^7.0.2", "jest": "^27.0.6", "lint-staged": "^11.0.1", "memfs": "^3.2.2", @@ -3120,9 +3120,9 @@ } }, "node_modules/@swc/core": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.80.tgz", - "integrity": "sha512-Giu6t8UrQG/1vwKZkYXLFiOmKB9+OC65AoR8g8O0m47oNtPIOWa3zBTcnP236/+edFS6VYPLBTzYj2yjLpUgwg==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.82.tgz", + "integrity": "sha512-AwQguRjv2myDabCtFPLwJypUiXkMREh+9CwCIOIaMf52ZCexpJt+Ir6LCrvrzx4VgzIBpsV0ivQBexLSdQRIlw==", "dev": true, "dependencies": { "@node-rs/helper": "^1.0.0" @@ -3135,24 +3135,24 @@ "url": "https://opencollective.com/swc" }, "optionalDependencies": { - "@swc/core-android-arm64": "^1.2.80", - "@swc/core-darwin-arm64": "^1.2.80", - "@swc/core-darwin-x64": "^1.2.80", - "@swc/core-freebsd-x64": "^1.2.80", - "@swc/core-linux-arm-gnueabihf": "^1.2.80", - "@swc/core-linux-arm64-gnu": "^1.2.80", - "@swc/core-linux-arm64-musl": "^1.2.80", - "@swc/core-linux-x64-gnu": "^1.2.80", - "@swc/core-linux-x64-musl": "^1.2.80", - "@swc/core-win32-arm64-msvc": "^1.2.80", - "@swc/core-win32-ia32-msvc": "^1.2.80", - "@swc/core-win32-x64-msvc": "^1.2.80" + "@swc/core-android-arm64": "^1.2.82", + "@swc/core-darwin-arm64": "^1.2.82", + "@swc/core-darwin-x64": "^1.2.82", + "@swc/core-freebsd-x64": "^1.2.82", + "@swc/core-linux-arm-gnueabihf": "^1.2.82", + "@swc/core-linux-arm64-gnu": "^1.2.82", + "@swc/core-linux-arm64-musl": "^1.2.82", + "@swc/core-linux-x64-gnu": "^1.2.82", + "@swc/core-linux-x64-musl": "^1.2.82", + "@swc/core-win32-arm64-msvc": "^1.2.82", + "@swc/core-win32-ia32-msvc": "^1.2.82", + "@swc/core-win32-x64-msvc": "^1.2.82" } }, "node_modules/@swc/core-android-arm64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-android-arm64/-/core-android-arm64-1.2.80.tgz", - "integrity": "sha512-hnjv2cByEgzaOWEV/Y59iAqmaiRbAIcfZzgHPVCqcFx9RRDUgGUbZt/D0kmYF3TWoXADILOe5pNs/38xR/HspQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-android-arm64/-/core-android-arm64-1.2.82.tgz", + "integrity": "sha512-E0p46nLUvy7xO6CDlOUGzE/DpWFpRsi6ZrEnJxY4/Xk9G/EKer/+2NSVk2Vs2Df6GlZyyCiTWYr0SZjyx18dVA==", "cpu": [ "arm64" ], @@ -3166,9 +3166,9 @@ } }, "node_modules/@swc/core-darwin-arm64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.80.tgz", - "integrity": "sha512-oLF+Ri/ctrhT5YAWJoE5Sod92Ih9wEP2pKVRWhJct6CmxGs3ZQd3n2iJEoB0JoIKGiDpHZ89GpD7NXhxv/JtxA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.82.tgz", + "integrity": "sha512-cW/RxV5TMKPTTgz4I0qBGpjqGAP7J+z90Z5sWwnzdomz12cKdEVOs/ZFw/j/TUs5m44Gf4zXq97y5mCY2HehvA==", "cpu": [ "arm64" ], @@ -3182,9 +3182,9 @@ } }, "node_modules/@swc/core-darwin-x64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.2.80.tgz", - "integrity": "sha512-0mwJjbfyW7LzIVqKpl6ALAgNa4o0ECbVqoMPWIz2GqnTwwd3Eg2y2uraQfR5Y5J1GGdcTkm+ndPjS0OmZMMzJg==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.2.82.tgz", + "integrity": "sha512-IU9a2SrCkfIyoYyEDXXGLNUak9QrivDOpSwAVmv1MRWfJlx8UByfUd9y+Cd/7SaV3380d70rUXtuW/IZtcC17Q==", "cpu": [ "x64" ], @@ -3198,9 +3198,9 @@ } }, "node_modules/@swc/core-freebsd-x64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.80.tgz", - "integrity": "sha512-31JM6FNjyWBmTs2RoQ6Ec+Hv1viarrea7hJl7WQ2/RqMGQ4/z5rRwkqPnDb/JyUV62UKY+Q30Y9ykeQLhVF3fA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.82.tgz", + "integrity": "sha512-VLf+216RdWo+pzPCevfK6v56RkRkhOIVOdaQ5bJJf4co0DCF1V48eWRUDUNZZySvpMcguOIz4Dwnoukd0EKJLA==", "cpu": [ "x64" ], @@ -3214,9 +3214,9 @@ } }, "node_modules/@swc/core-linux-arm-gnueabihf": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.80.tgz", - "integrity": "sha512-wTrM1tMZTBLg8BuGqqxjsJ3bxasX8UU+brHlgiOebq/3051MZebXU7pvpXEVMmnk1VY129khvEV7MUCU1+YtfA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.82.tgz", + "integrity": "sha512-sBZmwVTl3iCq7VPO644Rd3tL496/Z/w6pfyF3hM0zNuOxNZEVX0l+h5sYK6j09YJH0Tjav0J8tDqKyNZcLtG2Q==", "cpu": [ "arm" ], @@ -3230,9 +3230,9 @@ } }, "node_modules/@swc/core-linux-arm64-gnu": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.80.tgz", - "integrity": "sha512-FQQ5vDeF8DZWWHkcUPj3EohYq8IIFE/THuaQt6yVD83IQZduLrR0hW0qf96Ja0U160IdWO1uQYHHzxmxAl2urQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.82.tgz", + "integrity": "sha512-vUY8ImKdicP+hAqY9erYgueZ0TngaiOVC64coHKdKLtU7ta+4yL4+vEGPtxd6dPRiHFx3Z7z5nGgAq8ySWGCLw==", "cpu": [ "arm64" ], @@ -3246,9 +3246,9 @@ } }, "node_modules/@swc/core-linux-arm64-musl": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.80.tgz", - "integrity": "sha512-WXTxU7XgqlJjWUhrtJ0k6b3BnS5EzHs/gQ/Ry5poMmdbA6vXbVlQmo+KhEJou3ejPkC6ss+evLkznW/0os9bGQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.82.tgz", + "integrity": "sha512-6rUkIYlBePAEviKMgsgA/yP/3+NjnKVzCfhL4vrXaw1VSurSW4bUpXza8uq1j59HJDo68FemxG9nt3XFoCOn1A==", "cpu": [ "arm64" ], @@ -3262,9 +3262,9 @@ } }, "node_modules/@swc/core-linux-x64-gnu": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.80.tgz", - "integrity": "sha512-ubGScZ+oQ5TuRv5mCYDhRiHdsSKRu6OKhOwBKxzfZaMamFBYav9F4GyerVTlC1fnqd1gu/N+IJUjSIdXR3lEDQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.82.tgz", + "integrity": "sha512-1EUBJWrbtUV4LhoDwpUKeoTa5AnlGu3VgTf+QeEy06IR8IpHN+KgyXTKAFO9Wo1vmXUTCELV+nd9QRMobs2mDg==", "cpu": [ "x64" ], @@ -3278,9 +3278,9 @@ } }, "node_modules/@swc/core-linux-x64-musl": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.80.tgz", - "integrity": "sha512-gX6TH+mx0tjqNSz4Q8aQVkOIDFpAcJdzoRGlBBFcmrMP1pIGrBfPSLivK1ijU84Wg3I5VbMkkNV8mrw/tEjI+w==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.82.tgz", + "integrity": "sha512-52JioRQSToGdjwGrZ3fN4EfrPdV9UksDfE2C6sqeGH2rDBWmW6S4z3ws84f+g+X2uPgWIvXp9FSxaMFKnLaaWg==", "cpu": [ "x64" ], @@ -3294,9 +3294,9 @@ } }, "node_modules/@swc/core-win32-arm64-msvc": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.80.tgz", - "integrity": "sha512-ncw2t6QwXPEfVNG4w+IjIQ4PXwTd3C3XxwI/+AZ7f05SLVhfL2WHEM0ICV81Hq1/o65MCwM4VlU+4QgR0EpWyQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.82.tgz", + "integrity": "sha512-fWU4u7Z558oNMaFiZOy6e0ovCdJidBFQj7RQU/qc8IyqpgTe0/xuSvHA090KESwdQdcm/Tp1mwwrNkPLZCvcCQ==", "cpu": [ "arm64" ], @@ -3310,9 +3310,9 @@ } }, "node_modules/@swc/core-win32-ia32-msvc": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.80.tgz", - "integrity": "sha512-+fztR/JGZ49r/zodGbmlJn/T+Okoerh+qfzKSyQ/ic3kd0NO5nQ6HExNH1kzjCcuPvOcuAe1YIfREw9FiwvaUA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.82.tgz", + "integrity": "sha512-PQzVDUtlBff6GD3+3+eToM4UKZhUj25nL451iq0Ch2cct3Uxxul9D5+GSqNNcrCP0RIaQjTmcah9zlN6JbruKQ==", "cpu": [ "ia32" ], @@ -3326,9 +3326,9 @@ } }, "node_modules/@swc/core-win32-x64-msvc": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.80.tgz", - "integrity": "sha512-xtisiMbVBoP6tOb1euTnvRwlBHr81iRnVOo+h1tWBdHAuZddAR/9gKo6TMcZ94jqFLQimbDcaghJ48Tp4R31dw==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.82.tgz", + "integrity": "sha512-fcjhmQ3Ze4oGOpXdPgHBO8wdGzNkM9R82/wK71xg8R5wvevieRbBuVR+B65DmodE/zYtYkVifhBwycD/B4129Q==", "cpu": [ "x64" ], @@ -3465,6 +3465,12 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -3478,9 +3484,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.2.tgz", - "integrity": "sha512-LSw8TZt12ZudbpHc6EkIyDM3nHVWKYrAvGy6EAJfNfjusbwnThqjqxUKKRwuV3iWYeW/LYMzNgaq3MaLffQ2xA==" + "version": "16.7.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.2.tgz", + "integrity": "sha512-TbG4TOx9hng8FKxaVrCisdaxKxqEwJ3zwHoCWXZ0Jw6mnvTInpaB99/2Cy4+XxpXtjNv9/TgfGSvZFyfV/t8Fw==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -5186,12 +5192,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.16.2.tgz", - "integrity": "sha512-4lUshXtBXsdmp8cDWh6KKiHUg40AjiuPD3bOWkNVsr1xkAhpUqCjaZ8lB1bKx9Gb5fXcbRbFJ4f4qpRIRTuJqQ==", + "version": "3.16.3", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.16.3.tgz", + "integrity": "sha512-A/OtSfSJQKLAFRVd4V0m6Sep9lPdjD8bpN8v3tCCGwE0Tmh0hOiVDm9tw6mXmWOKOSZIyr3EkywPo84cJjGvIQ==", "dev": true, "dependencies": { - "browserslist": "^4.16.7", + "browserslist": "^4.16.8", "semver": "7.0.0" }, "funding": { @@ -5215,9 +5221,9 @@ "dev": true }, "node_modules/cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", + "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", "dev": true, "dependencies": { "@types/parse-json": "^4.0.0", @@ -5895,9 +5901,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.3.812", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.812.tgz", - "integrity": "sha512-7KiUHsKAWtSrjVoTSzxQ0nPLr/a+qoxNZwkwd9LkylTOgOXSVXkQbpIVT0WAUQcI5gXq3SwOTCrK+WfINHOXQg==", + "version": "1.3.818", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.818.tgz", + "integrity": "sha512-c/Z9gIr+jDZAR9q+mn40hEc1NharBT+8ejkarjbCDnBNFviI6hvcC5j2ezkAXru//bTnQp5n6iPi0JA83Tla1Q==", "dev": true }, "node_modules/emittery": { @@ -6016,9 +6022,9 @@ } }, "node_modules/esbuild": { - "version": "0.12.21", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.21.tgz", - "integrity": "sha512-7hyXbU3g94aREufI/5nls7Xcc+RGQeZWZApm6hoBaFvt2BPtpT4TjFMQ9Tb1jU8XyBGz00ShmiyflCogphMHFQ==", + "version": "0.12.23", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.23.tgz", + "integrity": "sha512-qvS4aKnmKikoWGscd5lVAzgobMovlH/JhaWitRiQ8xJx0x1Fym0pqVjMFs43Nvff8WpibeWm+fWoLK88T1U0Xw==", "dev": true, "hasInstallScript": true, "bin": { @@ -6236,26 +6242,26 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.0.tgz", - "integrity": "sha512-Kc6xqT9hiYi2cgybOc0I2vC9OgAYga5o/rAFinam/yF/t5uBqxQbauNPMC6fgb640T/89P0gFoO27FOilJ/Cqg==", + "version": "2.24.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz", + "integrity": "sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q==", "dev": true, "dependencies": { "array-includes": "^3.1.3", "array.prototype.flat": "^1.2.4", "debug": "^2.6.9", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.5", + "eslint-import-resolver-node": "^0.3.6", "eslint-module-utils": "^2.6.2", "find-up": "^2.0.0", "has": "^1.0.3", - "is-core-module": "^2.4.0", + "is-core-module": "^2.6.0", "minimatch": "^3.0.4", - "object.values": "^1.1.3", + "object.values": "^1.1.4", "pkg-up": "^2.0.0", "read-pkg-up": "^3.0.0", "resolve": "^1.20.0", - "tsconfig-paths": "^3.9.0" + "tsconfig-paths": "^3.11.0" }, "engines": { "node": ">=4" @@ -7803,9 +7809,9 @@ } }, "node_modules/husky": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.1.tgz", - "integrity": "sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", + "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", "dev": true, "bin": { "husky": "lib/bin.js" @@ -14136,9 +14142,9 @@ } }, "node_modules/terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.2.tgz", + "integrity": "sha512-0Omye+RD4X7X69O0eql3lC4Heh/5iLj3ggxR/B5ketZLOtLiOqukUgjw3q4PDnNQbsrkKr3UMypqStQG3XKRvw==", "dependencies": { "commander": "^2.20.0", "source-map": "~0.7.2", @@ -14391,16 +14397,29 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", - "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz", + "integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==", "dev": true, "dependencies": { - "json5": "^2.2.0", + "@types/json5": "^0.0.29", + "json5": "^1.0.1", "minimist": "^1.2.0", "strip-bom": "^3.0.0" } }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -17314,107 +17333,107 @@ } }, "@swc/core": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.80.tgz", - "integrity": "sha512-Giu6t8UrQG/1vwKZkYXLFiOmKB9+OC65AoR8g8O0m47oNtPIOWa3zBTcnP236/+edFS6VYPLBTzYj2yjLpUgwg==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.82.tgz", + "integrity": "sha512-AwQguRjv2myDabCtFPLwJypUiXkMREh+9CwCIOIaMf52ZCexpJt+Ir6LCrvrzx4VgzIBpsV0ivQBexLSdQRIlw==", "dev": true, "requires": { "@node-rs/helper": "^1.0.0", - "@swc/core-android-arm64": "^1.2.80", - "@swc/core-darwin-arm64": "^1.2.80", - "@swc/core-darwin-x64": "^1.2.80", - "@swc/core-freebsd-x64": "^1.2.80", - "@swc/core-linux-arm-gnueabihf": "^1.2.80", - "@swc/core-linux-arm64-gnu": "^1.2.80", - "@swc/core-linux-arm64-musl": "^1.2.80", - "@swc/core-linux-x64-gnu": "^1.2.80", - "@swc/core-linux-x64-musl": "^1.2.80", - "@swc/core-win32-arm64-msvc": "^1.2.80", - "@swc/core-win32-ia32-msvc": "^1.2.80", - "@swc/core-win32-x64-msvc": "^1.2.80" + "@swc/core-android-arm64": "^1.2.82", + "@swc/core-darwin-arm64": "^1.2.82", + "@swc/core-darwin-x64": "^1.2.82", + "@swc/core-freebsd-x64": "^1.2.82", + "@swc/core-linux-arm-gnueabihf": "^1.2.82", + "@swc/core-linux-arm64-gnu": "^1.2.82", + "@swc/core-linux-arm64-musl": "^1.2.82", + "@swc/core-linux-x64-gnu": "^1.2.82", + "@swc/core-linux-x64-musl": "^1.2.82", + "@swc/core-win32-arm64-msvc": "^1.2.82", + "@swc/core-win32-ia32-msvc": "^1.2.82", + "@swc/core-win32-x64-msvc": "^1.2.82" } }, "@swc/core-android-arm64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-android-arm64/-/core-android-arm64-1.2.80.tgz", - "integrity": "sha512-hnjv2cByEgzaOWEV/Y59iAqmaiRbAIcfZzgHPVCqcFx9RRDUgGUbZt/D0kmYF3TWoXADILOe5pNs/38xR/HspQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-android-arm64/-/core-android-arm64-1.2.82.tgz", + "integrity": "sha512-E0p46nLUvy7xO6CDlOUGzE/DpWFpRsi6ZrEnJxY4/Xk9G/EKer/+2NSVk2Vs2Df6GlZyyCiTWYr0SZjyx18dVA==", "dev": true, "optional": true }, "@swc/core-darwin-arm64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.80.tgz", - "integrity": "sha512-oLF+Ri/ctrhT5YAWJoE5Sod92Ih9wEP2pKVRWhJct6CmxGs3ZQd3n2iJEoB0JoIKGiDpHZ89GpD7NXhxv/JtxA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.82.tgz", + "integrity": "sha512-cW/RxV5TMKPTTgz4I0qBGpjqGAP7J+z90Z5sWwnzdomz12cKdEVOs/ZFw/j/TUs5m44Gf4zXq97y5mCY2HehvA==", "dev": true, "optional": true }, "@swc/core-darwin-x64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.2.80.tgz", - "integrity": "sha512-0mwJjbfyW7LzIVqKpl6ALAgNa4o0ECbVqoMPWIz2GqnTwwd3Eg2y2uraQfR5Y5J1GGdcTkm+ndPjS0OmZMMzJg==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.2.82.tgz", + "integrity": "sha512-IU9a2SrCkfIyoYyEDXXGLNUak9QrivDOpSwAVmv1MRWfJlx8UByfUd9y+Cd/7SaV3380d70rUXtuW/IZtcC17Q==", "dev": true, "optional": true }, "@swc/core-freebsd-x64": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.80.tgz", - "integrity": "sha512-31JM6FNjyWBmTs2RoQ6Ec+Hv1viarrea7hJl7WQ2/RqMGQ4/z5rRwkqPnDb/JyUV62UKY+Q30Y9ykeQLhVF3fA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.82.tgz", + "integrity": "sha512-VLf+216RdWo+pzPCevfK6v56RkRkhOIVOdaQ5bJJf4co0DCF1V48eWRUDUNZZySvpMcguOIz4Dwnoukd0EKJLA==", "dev": true, "optional": true }, "@swc/core-linux-arm-gnueabihf": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.80.tgz", - "integrity": "sha512-wTrM1tMZTBLg8BuGqqxjsJ3bxasX8UU+brHlgiOebq/3051MZebXU7pvpXEVMmnk1VY129khvEV7MUCU1+YtfA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.82.tgz", + "integrity": "sha512-sBZmwVTl3iCq7VPO644Rd3tL496/Z/w6pfyF3hM0zNuOxNZEVX0l+h5sYK6j09YJH0Tjav0J8tDqKyNZcLtG2Q==", "dev": true, "optional": true }, "@swc/core-linux-arm64-gnu": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.80.tgz", - "integrity": "sha512-FQQ5vDeF8DZWWHkcUPj3EohYq8IIFE/THuaQt6yVD83IQZduLrR0hW0qf96Ja0U160IdWO1uQYHHzxmxAl2urQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.82.tgz", + "integrity": "sha512-vUY8ImKdicP+hAqY9erYgueZ0TngaiOVC64coHKdKLtU7ta+4yL4+vEGPtxd6dPRiHFx3Z7z5nGgAq8ySWGCLw==", "dev": true, "optional": true }, "@swc/core-linux-arm64-musl": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.80.tgz", - "integrity": "sha512-WXTxU7XgqlJjWUhrtJ0k6b3BnS5EzHs/gQ/Ry5poMmdbA6vXbVlQmo+KhEJou3ejPkC6ss+evLkznW/0os9bGQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.82.tgz", + "integrity": "sha512-6rUkIYlBePAEviKMgsgA/yP/3+NjnKVzCfhL4vrXaw1VSurSW4bUpXza8uq1j59HJDo68FemxG9nt3XFoCOn1A==", "dev": true, "optional": true }, "@swc/core-linux-x64-gnu": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.80.tgz", - "integrity": "sha512-ubGScZ+oQ5TuRv5mCYDhRiHdsSKRu6OKhOwBKxzfZaMamFBYav9F4GyerVTlC1fnqd1gu/N+IJUjSIdXR3lEDQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.82.tgz", + "integrity": "sha512-1EUBJWrbtUV4LhoDwpUKeoTa5AnlGu3VgTf+QeEy06IR8IpHN+KgyXTKAFO9Wo1vmXUTCELV+nd9QRMobs2mDg==", "dev": true, "optional": true }, "@swc/core-linux-x64-musl": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.80.tgz", - "integrity": "sha512-gX6TH+mx0tjqNSz4Q8aQVkOIDFpAcJdzoRGlBBFcmrMP1pIGrBfPSLivK1ijU84Wg3I5VbMkkNV8mrw/tEjI+w==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.82.tgz", + "integrity": "sha512-52JioRQSToGdjwGrZ3fN4EfrPdV9UksDfE2C6sqeGH2rDBWmW6S4z3ws84f+g+X2uPgWIvXp9FSxaMFKnLaaWg==", "dev": true, "optional": true }, "@swc/core-win32-arm64-msvc": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.80.tgz", - "integrity": "sha512-ncw2t6QwXPEfVNG4w+IjIQ4PXwTd3C3XxwI/+AZ7f05SLVhfL2WHEM0ICV81Hq1/o65MCwM4VlU+4QgR0EpWyQ==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.82.tgz", + "integrity": "sha512-fWU4u7Z558oNMaFiZOy6e0ovCdJidBFQj7RQU/qc8IyqpgTe0/xuSvHA090KESwdQdcm/Tp1mwwrNkPLZCvcCQ==", "dev": true, "optional": true }, "@swc/core-win32-ia32-msvc": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.80.tgz", - "integrity": "sha512-+fztR/JGZ49r/zodGbmlJn/T+Okoerh+qfzKSyQ/ic3kd0NO5nQ6HExNH1kzjCcuPvOcuAe1YIfREw9FiwvaUA==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.82.tgz", + "integrity": "sha512-PQzVDUtlBff6GD3+3+eToM4UKZhUj25nL451iq0Ch2cct3Uxxul9D5+GSqNNcrCP0RIaQjTmcah9zlN6JbruKQ==", "dev": true, "optional": true }, "@swc/core-win32-x64-msvc": { - "version": "1.2.80", - "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.80.tgz", - "integrity": "sha512-xtisiMbVBoP6tOb1euTnvRwlBHr81iRnVOo+h1tWBdHAuZddAR/9gKo6TMcZ94jqFLQimbDcaghJ48Tp4R31dw==", + "version": "1.2.82", + "resolved": "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.82.tgz", + "integrity": "sha512-fcjhmQ3Ze4oGOpXdPgHBO8wdGzNkM9R82/wK71xg8R5wvevieRbBuVR+B65DmodE/zYtYkVifhBwycD/B4129Q==", "dev": true, "optional": true }, @@ -17539,6 +17558,12 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -17552,9 +17577,9 @@ "dev": true }, "@types/node": { - "version": "16.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.6.2.tgz", - "integrity": "sha512-LSw8TZt12ZudbpHc6EkIyDM3nHVWKYrAvGy6EAJfNfjusbwnThqjqxUKKRwuV3iWYeW/LYMzNgaq3MaLffQ2xA==" + "version": "16.7.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.2.tgz", + "integrity": "sha512-TbG4TOx9hng8FKxaVrCisdaxKxqEwJ3zwHoCWXZ0Jw6mnvTInpaB99/2Cy4+XxpXtjNv9/TgfGSvZFyfV/t8Fw==" }, "@types/normalize-package-data": { "version": "2.4.1", @@ -18927,12 +18952,12 @@ } }, "core-js-compat": { - "version": "3.16.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.16.2.tgz", - "integrity": "sha512-4lUshXtBXsdmp8cDWh6KKiHUg40AjiuPD3bOWkNVsr1xkAhpUqCjaZ8lB1bKx9Gb5fXcbRbFJ4f4qpRIRTuJqQ==", + "version": "3.16.3", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.16.3.tgz", + "integrity": "sha512-A/OtSfSJQKLAFRVd4V0m6Sep9lPdjD8bpN8v3tCCGwE0Tmh0hOiVDm9tw6mXmWOKOSZIyr3EkywPo84cJjGvIQ==", "dev": true, "requires": { - "browserslist": "^4.16.7", + "browserslist": "^4.16.8", "semver": "7.0.0" }, "dependencies": { @@ -18951,9 +18976,9 @@ "dev": true }, "cosmiconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", - "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", + "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", "dev": true, "requires": { "@types/parse-json": "^4.0.0", @@ -19461,9 +19486,9 @@ } }, "electron-to-chromium": { - "version": "1.3.812", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.812.tgz", - "integrity": "sha512-7KiUHsKAWtSrjVoTSzxQ0nPLr/a+qoxNZwkwd9LkylTOgOXSVXkQbpIVT0WAUQcI5gXq3SwOTCrK+WfINHOXQg==", + "version": "1.3.818", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.818.tgz", + "integrity": "sha512-c/Z9gIr+jDZAR9q+mn40hEc1NharBT+8ejkarjbCDnBNFviI6hvcC5j2ezkAXru//bTnQp5n6iPi0JA83Tla1Q==", "dev": true }, "emittery": { @@ -19555,9 +19580,9 @@ } }, "esbuild": { - "version": "0.12.21", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.21.tgz", - "integrity": "sha512-7hyXbU3g94aREufI/5nls7Xcc+RGQeZWZApm6hoBaFvt2BPtpT4TjFMQ9Tb1jU8XyBGz00ShmiyflCogphMHFQ==", + "version": "0.12.23", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.23.tgz", + "integrity": "sha512-qvS4aKnmKikoWGscd5lVAzgobMovlH/JhaWitRiQ8xJx0x1Fym0pqVjMFs43Nvff8WpibeWm+fWoLK88T1U0Xw==", "dev": true }, "escalade": { @@ -19820,26 +19845,26 @@ } }, "eslint-plugin-import": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.0.tgz", - "integrity": "sha512-Kc6xqT9hiYi2cgybOc0I2vC9OgAYga5o/rAFinam/yF/t5uBqxQbauNPMC6fgb640T/89P0gFoO27FOilJ/Cqg==", + "version": "2.24.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz", + "integrity": "sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q==", "dev": true, "requires": { "array-includes": "^3.1.3", "array.prototype.flat": "^1.2.4", "debug": "^2.6.9", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.5", + "eslint-import-resolver-node": "^0.3.6", "eslint-module-utils": "^2.6.2", "find-up": "^2.0.0", "has": "^1.0.3", - "is-core-module": "^2.4.0", + "is-core-module": "^2.6.0", "minimatch": "^3.0.4", - "object.values": "^1.1.3", + "object.values": "^1.1.4", "pkg-up": "^2.0.0", "read-pkg-up": "^3.0.0", "resolve": "^1.20.0", - "tsconfig-paths": "^3.9.0" + "tsconfig-paths": "^3.11.0" }, "dependencies": { "debug": { @@ -20920,9 +20945,9 @@ "dev": true }, "husky": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.1.tgz", - "integrity": "sha512-gceRaITVZ+cJH9sNHqx5tFwbzlLCVxtVZcusME8JYQ8Edy5mpGDOqD8QBCdMhpyo9a+JXddnujQ4rpY2Ff9SJA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.2.tgz", + "integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==", "dev": true }, "iconv-lite": { @@ -25714,9 +25739,9 @@ } }, "terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.2.tgz", + "integrity": "sha512-0Omye+RD4X7X69O0eql3lC4Heh/5iLj3ggxR/B5ketZLOtLiOqukUgjw3q4PDnNQbsrkKr3UMypqStQG3XKRvw==", "requires": { "commander": "^2.20.0", "source-map": "~0.7.2", @@ -25916,16 +25941,26 @@ "dev": true }, "tsconfig-paths": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", - "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz", + "integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==", "dev": true, "requires": { - "json5": "^2.2.0", + "@types/json5": "^0.0.29", + "json5": "^1.0.1", "minimist": "^1.2.0", "strip-bom": "^3.0.0" }, "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", diff --git a/package.json b/package.json index 81bdd7a..9a96e27 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "url": "https://opencollective.com/webpack" }, "main": "dist/cjs.js", + "types": "types/index.d.ts", "engines": { "node": ">= 10.13.0" }, @@ -19,7 +20,7 @@ "start": "npm run build -- -w", "clean": "del-cli dist", "prebuild": "npm run clean", - "_build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write", + "build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write && prettier types --write", "build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files", "build": "npm-run-all -p \"build:**\"", "commitlint": "commitlint --from=master", @@ -60,7 +61,7 @@ "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^5.7.1" + "terser": "^5.7.2" }, "devDependencies": { "@babel/cli": "^7.14.8", @@ -68,7 +69,7 @@ "@babel/preset-env": "^7.14.9", "@commitlint/cli": "^13.1.0", "@commitlint/config-conventional": "^13.1.0", - "@swc/core": "^1.2.78", + "@swc/core": "^1.2.82", "@types/serialize-javascript": "^5.0.1", "@types/uglify-js": "^3.13.1", "@webpack-contrib/eslint-config-webpack": "^3.0.0", @@ -77,12 +78,12 @@ "cross-env": "^7.0.3", "del": "^6.0.0", "del-cli": "^3.0.1", - "esbuild": "^0.12.20", + "esbuild": "^0.12.23", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-import": "^2.22.1", + "eslint-plugin-import": "^2.24.2", "file-loader": "^6.2.0", - "husky": "^7.0.0", + "husky": "^7.0.2", "jest": "^27.0.6", "lint-staged": "^11.0.1", "memfs": "^3.2.2", diff --git a/src/index.js b/src/index.js index 5d6559f..6ea51da 100644 --- a/src/index.js +++ b/src/index.js @@ -28,6 +28,7 @@ import { minify as minifyFn } from "./minify"; /** @typedef {import("uglify-js").MinifyOptions} UglifyJSMinifyOptions */ /** @typedef {import("@swc/core").JsMinifyOptions} SwcMinifyOptions */ /** @typedef {import("esbuild").TransformOptions} EsbuildMinifyOptions */ +/** @typedef {Object.} CustomMinifyOptions */ /** @typedef {import("jest-worker").Worker} JestWorker */ /** @typedef {import("source-map").RawSourceMap} RawSourceMap */ @@ -35,8 +36,6 @@ import { minify as minifyFn } from "./minify"; /** @typedef {Rule[] | Rule} Rules */ -/** @typedef {JestWorker & { transform: (options: string) => MinifyResult, minify: (options: InternalMinifyOptions) => MinifyResult }} MinifyWorker */ - /** * @callback ExtractCommentsFunction * @param {any} astNode @@ -64,122 +63,109 @@ import { minify as minifyFn } from "./minify"; */ /** - * @typedef {{ [file: string]: string }} Input + * @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions */ /** - * @typedef {Object.} CustomMinifyOptions + * @typedef {{ [file: string]: string }} Input */ /** - * @callback MinifyFunction - * @param {Input} input - * @param {RawSourceMap | undefined} sourceMap - * @param {CustomMinifyOptions} minifyOptions - * @param {ExtractCommentsOptions | undefined} extractComments - * @returns {Promise} + * @typedef {Object} MinifyResult + * @property {string} code + * @property {RawSourceMap} [map] + * @property {Array} [errors] + * @property {Array} [warnings] + * @property {Array} [extractedComments] */ /** - * @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions + * @typedef {Object} InternalPredefinedMinimizerOptions + * @property {boolean} [module] + * @property {5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020} [ecma] */ /** + * @template T * @typedef {Object} InternalMinifyOptions * @property {string} name * @property {string} input * @property {RawSourceMap | undefined} inputSourceMap * @property {ExtractCommentsOptions | undefined} extractComments - * @property {MinifyFunction} minify - * @property {TerserMinifyOptions | CustomMinifyOptions} minifyOptions + * @property {MinifyFunction} minify + * @property {InternalPredefinedMinimizerOptions & T} minifyOptions */ /** - * @typedef {Object} MinifyResult - * @property {string} code - * @property {RawSourceMap} [map] - * @property {Array} [errors] - * @property {Array} [warnings] - * @property {Array} [extractedComments] - * @property {Array} [extractedComments] + * @template T + * @typedef {JestWorker & { transform: (options: string) => MinifyResult, minify: (options: InternalMinifyOptions) => MinifyResult }} MinifyWorker */ /** - * @typedef {Object} PluginOptionsForTerser - * @property {Rules} [test] - * @property {Rules} [include] - * @property {Rules} [exclude] - * @property {TerserMinifyOptions} [terserOptions] - * @property {ExtractCommentsOptions} [extractComments] - * @property {boolean} [parallel] - * @property {terserMinify} minify + * @template T + * @callback MinifyFunction + * @param {Input} input + * @param {RawSourceMap | undefined} sourceMap + * @param {InternalPredefinedMinimizerOptions & T} minifyOptions + * @param {ExtractCommentsOptions | undefined} extractComments + * @returns {Promise} */ /** - * @typedef {Object} PluginOptionsForUglifyJS - * @property {Rules} [test] - * @property {Rules} [include] - * @property {Rules} [exclude] - * @property {UglifyJSMinifyOptions} [terserOptions] - * @property {ExtractCommentsOptions} [extractComments] - * @property {boolean} [parallel] - * @property {uglifyJsMinify} minify + * @typedef {MinifyFunction} TerserMinifyFunction */ /** - * @typedef {Object} PluginOptionsForSwc - * @property {Rules} [test] - * @property {Rules} [include] - * @property {Rules} [exclude] - * @property {SwcMinifyOptions} [terserOptions] - * @property {ExtractCommentsOptions} [extractComments] - * @property {boolean} [parallel] - * @property {swcMinify} minify + * @typedef {MinifyFunction} UglifyJSMinifyFunction */ /** - * @typedef {Object} PluginOptionsForEsbuild - * @property {Rules} [test] - * @property {Rules} [include] - * @property {Rules} [exclude] - * @property {EsbuildMinifyOptions} [terserOptions] - * @property {ExtractCommentsOptions} [extractComments] - * @property {boolean} [parallel] - * @property {swcMinify} minify + * @typedef {MinifyFunction} SwcMinifyFunction + */ + +/** + * @typedef {MinifyFunction} EsbuildMinifyFunction + */ + +/** + * @typedef {MinifyFunction} CustomMinifyFunction */ /** - * @typedef {Object} PluginOptionsForCustomMinifyFunction + * @typedef {Object} BasePluginOptions * @property {Rules} [test] * @property {Rules} [include] * @property {Rules} [exclude] - * @property {CustomMinifyOptions} [terserOptions] * @property {ExtractCommentsOptions} [extractComments] * @property {boolean} [parallel] - * @property {MinifyFunction} minify + */ + +/** + * @template T + * @typedef {T extends (arg1: any, arg2: any, arg3: infer U, ...args: any[]) => any ? U: never} ThirdArgument */ /** * @typedef {Object} DefaultPluginOptions - * @property {Rules} [test] - * @property {Rules} [include] - * @property {Rules} [exclude] * @property {TerserMinifyOptions} [terserOptions] - * @property {ExtractCommentsOptions} [extractComments] - * @property {boolean} [parallel] - * @property {terserMinify} [minify] + * @property {undefined} [minify] */ /** - * @typedef {DefaultPluginOptions | PluginOptionsForTerser | PluginOptionsForUglifyJS | PluginOptionsForSwc | PluginOptionsForCustomMinifyFunction} PluginOptions + * @template T + * @typedef {T extends infer Z ? ThirdArgument extends never ? any : { minify?: Z; terserOptions?: ThirdArgument } : DefaultPluginOptions} PickMinifyOptions */ +// TODO please add manually `T extends ... = TerserMinifyFunction`, because typescript is not supported default value for templates yet +/** + * @template {TerserMinifyFunction | UglifyJSMinifyFunction | SwcMinifyFunction | EsbuildMinifyFunction | CustomMinifyFunction} T =TerserMinifyFunction + */ class TerserPlugin { /** - * @param {PluginOptions} [options={}] + * @param {BasePluginOptions & PickMinifyOptions} [options] */ - constructor(options = {}) { - validate(/** @type {Schema} */ (schema), options, { + constructor(options) { + validate(/** @type {Schema} */ (schema), options || {}, { name: "Terser Plugin", baseDataPath: "options", }); @@ -192,11 +178,8 @@ class TerserPlugin { parallel = true, include, exclude, - } = options; + } = options || {}; - /** - * @type {PluginOptionsForTerser | PluginOptionsForSwc | PluginOptionsForCustomMinifyFunction} - */ this.options = { test, extractComments, @@ -288,6 +271,7 @@ class TerserPlugin { } /** + * @private * @param {Compiler} compiler * @param {Compilation} compilation * @param {Record} assets @@ -340,9 +324,9 @@ class TerserPlugin { }) ); - /** @type {undefined | (() => MinifyWorker)} */ + /** @type {undefined | (() => MinifyWorker)} */ let getWorker; - /** @type {undefined | MinifyWorker} */ + /** @type {undefined | MinifyWorker} */ let initializedWorker; /** @type {undefined | number} */ let numberOfWorkers; @@ -360,7 +344,7 @@ class TerserPlugin { } initializedWorker = - /** @type {MinifyWorker} */ + /** @type {MinifyWorker} */ ( new Worker(require.resolve("./minify"), { numWorkers: numberOfWorkers, @@ -431,7 +415,7 @@ class TerserPlugin { input = input.toString(); } - /** @type {InternalMinifyOptions} */ + /** @type {InternalMinifyOptions} */ const options = { name, input, @@ -451,6 +435,12 @@ class TerserPlugin { } } + if (typeof options.minifyOptions.ecma === "undefined") { + options.minifyOptions.ecma = TerserPlugin.getEcmaVersion( + compiler.options.output.environment || {} + ); + } + try { output = await (getWorker ? getWorker().transform(serialize(options)) @@ -769,14 +759,6 @@ class TerserPlugin { * @returns {void} */ apply(compiler) { - const { output } = compiler.options; - - if (typeof this.options.terserOptions.ecma === "undefined") { - this.options.terserOptions.ecma = TerserPlugin.getEcmaVersion( - output.environment || {} - ); - } - const pluginName = this.constructor.name; const availableNumberOfCores = TerserPlugin.getAvailableNumberOfCores( this.options.parallel diff --git a/src/minify.js b/src/minify.js index e283852..bd2f4f3 100644 --- a/src/minify.js +++ b/src/minify.js @@ -1,8 +1,8 @@ -/** @typedef {import("./index.js").InternalMinifyOptions} InternalMinifyOptions */ /** @typedef {import("./index.js").MinifyResult} MinifyResult */ /** - * @param {InternalMinifyOptions} options + * @template T + * @param {import("./index.js").InternalMinifyOptions} options * @returns {Promise} */ async function minify(options) { @@ -32,7 +32,10 @@ async function transform(options) { // Safer for possible security issues, albeit not critical at all here // eslint-disable-next-line no-param-reassign const evaluatedOptions = - /** @type {InternalMinifyOptions} */ + /** + * @template T + * @type {import("./index.js").InternalMinifyOptions} + * */ ( // eslint-disable-next-line no-new-func new Function( diff --git a/src/options.json b/src/options.json index 82c7b96..83d2cfd 100644 --- a/src/options.json +++ b/src/options.json @@ -65,7 +65,7 @@ ] }, "terserOptions": { - "description": "Options for `terser`.", + "description": "Options for `terser` (by default) or custom `minify` function.", "link": "https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions", "additionalProperties": true, "type": "object" diff --git a/src/utils.js b/src/utils.js index ba667c4..e2facf5 100644 --- a/src/utils.js +++ b/src/utils.js @@ -10,6 +10,7 @@ /** @typedef {import("./index.js").ExtractCommentsCondition} ExtractCommentsCondition */ /** @typedef {import("./index.js").Input} Input */ /** @typedef {import("./index.js").MinifyResult} MinifyResult */ +/** @typedef {import("./index.js").InternalPredefinedMinimizerOptions} InternalPredefinedMinimizerOptions */ /** * @typedef {TerserMinifyOptions & { sourceMap: undefined } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })} NormalizedTerserMinifyOptions @@ -31,7 +32,7 @@ /** * @param {Input} input * @param {RawSourceMap | undefined} sourceMap - * @param {TerserMinifyOptions} minimizerOptions + * @param {InternalPredefinedMinimizerOptions & TerserMinifyOptions} minimizerOptions * @param {ExtractCommentsOptions | undefined} extractComments * @return {Promise} */ @@ -246,7 +247,7 @@ async function terserMinify( /** * @param {Input} input * @param {RawSourceMap | undefined} sourceMap - * @param {UglifyJSMinifyOptions} minimizerOptions + * @param {InternalPredefinedMinimizerOptions & UglifyJSMinifyOptions} minimizerOptions * @param {ExtractCommentsOptions | undefined} extractComments * @return {Promise} */ @@ -407,15 +408,13 @@ async function uglifyJsMinify( // eslint-disable-next-line global-require, import/no-extraneous-dependencies const { minify } = require("uglify-js"); - // TODO maybe revisit it in future - // Copy `uglify-js` options - // @ts-ignore + // eslint-disable-next-line no-param-reassign delete minimizerOptions.ecma; - // @ts-ignore // eslint-disable-next-line no-param-reassign delete minimizerOptions.module; + // Copy `uglify-js` options const uglifyJsOptions = buildUglifyJsOptions(minimizerOptions); // Let terser generate a SourceMap @@ -450,7 +449,7 @@ async function uglifyJsMinify( /** * @param {Input} input * @param {RawSourceMap | undefined} sourceMap - * @param {SwcMinifyOptions} minimizerOptions + * @param {InternalPredefinedMinimizerOptions & SwcMinifyOptions} minimizerOptions * @return {Promise} */ async function swcMinify(input, sourceMap, minimizerOptions) { @@ -508,7 +507,7 @@ async function swcMinify(input, sourceMap, minimizerOptions) { /** * @param {Input} input * @param {RawSourceMap | undefined} sourceMap - * @param {EsbuildMinifyOptions} minimizerOptions + * @param {InternalPredefinedMinimizerOptions & EsbuildMinifyOptions} minimizerOptions * @return {Promise} */ async function esbuildMinify(input, sourceMap, minimizerOptions) { @@ -529,19 +528,17 @@ async function esbuildMinify(input, sourceMap, minimizerOptions) { // eslint-disable-next-line import/no-extraneous-dependencies, global-require const esbuild = require("esbuild"); - // @ts-ignore // eslint-disable-next-line no-param-reassign delete minimizerOptions.ecma; - // @ts-ignore if (minimizerOptions.module) { // eslint-disable-next-line no-param-reassign minimizerOptions.format = "esm"; } - // @ts-ignore // eslint-disable-next-line no-param-reassign delete minimizerOptions.module; + // Copy `swc` options const esbuildOptions = buildEsbuildOptions(minimizerOptions); diff --git a/test/__snapshots__/TerserPlugin.test.js.snap b/test/__snapshots__/TerserPlugin.test.js.snap index 46b1fe4..c607232 100644 --- a/test/__snapshots__/TerserPlugin.test.js.snap +++ b/test/__snapshots__/TerserPlugin.test.js.snap @@ -57,7 +57,7 @@ exports[`TerserPlugin should emit an error on a broken code in parallel mode: wa exports[`TerserPlugin should regenerate hash: assets 1`] = ` Object { "598.598.fcfa82506be0724e60bc.js": "\\"use strict\\";(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", - "AsyncImportExport.40d32405ef9b7c555dcc.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".fcfa82506be0724e60bc.js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,c;if(void 0!==i)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),c&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,c]=t,u=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(c)c(n)}for(r&&r(t);u{console.log(\\"Good\\")}))})();", + "AsyncImportExport.8b9fb68a711f0a35fe41.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".fcfa82506be0724e60bc.js\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,u;if(void 0!==i)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),u&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)u(n)}for(r&&r(t);c{console.log(\\"Good\\")}))})();", "importExport.99516598f0f48417cbb9.js": "(()=>{\\"use strict\\";function o(){const o=\`baz\${Math.random()}\`;return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", "js.c9ed6ac3ba483bb3026c.js": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", "mjs.0129b52afdbf3c4da0cc.js": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", @@ -139,8 +139,8 @@ exports[`TerserPlugin should work and do not use memory cache when the "cache" o exports[`TerserPlugin should work and generate real content hash: assets 1`] = ` Object { - "598.fcfa82506be0724e60bc.5b03ff170f387fdb7ba4.300b03cdb418df62d913.js": "\\"use strict\\";(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", - "app.acc4adc172cd863afe2f.88feee150c21d3ce72c0.300b03cdb418df62d913.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".fcfa82506be0724e60bc.5b03ff170f387fdb7ba4.\\"+n.h()+\\".js\\",n.h=()=>\\"300b03cdb418df62d913\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a,i)=>{if(e[t])e[t].push(o);else{var l,c;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),c&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={143:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),l=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",l.name=\\"ChunkLoadError\\",l.type=a,l.request=i,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,l,c]=t,u=0;if(i.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(c)c(n)}for(r&&r(t);u{console.log(\\"Good\\")}))})();", + "598.fcfa82506be0724e60bc.d2f25312719ecc34526e.fe4772ccd5da7825a20d.js": "\\"use strict\\";(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "app.3bbac6f14850de0ecb28.15ae35ed817232f37aac.fe4772ccd5da7825a20d.js": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var a=o[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".fcfa82506be0724e60bc.d2f25312719ecc34526e.\\"+n.h()+\\".js\\",n.h=()=>\\"fe4772ccd5da7825a20d\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,a,i)=>{if(e[t])e[t].push(o);else{var c,l;if(void 0!==a)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{c.onerror=c.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],c.parentNode&&c.parentNode.removeChild(c),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(p.bind(null,void 0,{type:\\"timeout\\",target:c}),12e4);c.onerror=p.bind(null,c.onerror),c.onload=p.bind(null,c.onload),l&&document.head.appendChild(c)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={143:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var a=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=a);var i=n.p+n.u(r),c=new Error;n.l(i,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var a=t&&(\\"load\\"===t.type?\\"missing\\":t.type),i=t&&t.target&&t.target.src;c.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+a+\\": \\"+i+\\")\\",c.name=\\"ChunkLoadError\\",c.type=a,c.request=i,o[1](c)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,a,[i,c,l]=t,u=0;if(i.some((r=>0!==e[r]))){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);if(l)l(n)}for(r&&r(t);u{console.log(\\"Good\\")}))})();", } `; diff --git a/test/__snapshots__/extractComments-option.test.js.snap b/test/__snapshots__/extractComments-option.test.js.snap index 76ab1d1..fc8b428 100644 --- a/test/__snapshots__/extractComments-option.test.js.snap +++ b/test/__snapshots__/extractComments-option.test.js.snap @@ -4654,10 +4654,10 @@ exports[`extractComments option should match snapshot for a "function" value: wa exports[`extractComments option should match snapshot for comment file when filename is nested: assets 1`] = ` Object { - "nested/directory/627.js?f8ce81df71858f19a9f9": "/*! For license information please see ../../one.js */ + "nested/directory/627.js?510652952c2737442823": "/*! For license information please see ../../one.js */ (self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", - "nested/directory/one.js?6d08b984f766c0d2abaf": "/*! For license information please see ../../one.js */ -(()=>{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);a.r(n);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>i[e]=()=>r[e]));return i.default=()=>r,a.d(n,i),n},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>\\"nested/directory/\\"+e+\\".js?f8ce81df71858f19a9f9\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",a.l=(e,t,n,i)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(s.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e+\\"../../\\"})(),(()=>{var e={255:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=a.p+a.u(t),u=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),i=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=i,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[i,u,c]=r,l=0;if(i.some((t=>0!==e[t]))){for(o in u)a.o(u,o)&&(a.m[o]=u[o]);if(c)c(a)}for(t&&t(r);l{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);a.r(n);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>i[e]=()=>r[e]));return i.default=()=>r,a.d(n,i),n},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>\\"nested/directory/\\"+e+\\".js?510652952c2737442823\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",a.l=(e,t,n,i)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e+\\"../../\\"})(),(()=>{var e={255:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=a.p+a.u(t),u=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),i=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=i,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[i,u,c]=r,l=0;if(i.some((t=>0!==e[t]))){for(o in u)a.o(u,o)&&(a.m[o]=u[o]);if(c)c(a)}for(t&&t(r);l{e.exports=Math.random()}}]);", - "filename/four.js.LICENSE.txt?20530c418358196c3ed3": "/** + "filename/four.js.LICENSE.txt?3998f0a55467e3aebd7b": "/** * Duplicate comment in difference files. * @license MIT */ ", - "filename/four.js?20530c418358196c3ed3": "/*! For license information please see four.js.LICENSE.txt?20530c418358196c3ed3 */ + "filename/four.js?3998f0a55467e3aebd7b": "/*! For license information please see four.js.LICENSE.txt?3998f0a55467e3aebd7b */ (()=>{var r={712:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(712)})();", - "filename/one.js.LICENSE.txt?5fa383b2157306c9fb7e": "/*! Legal Comment */ + "filename/one.js.LICENSE.txt?7c40ed91808e0308e804": "/*! Legal Comment */ /*! Legal Foo */ @@ -5644,9 +5644,9 @@ Object { // @lic ", - "filename/one.js?5fa383b2157306c9fb7e": "/*! For license information please see one.js.LICENSE.txt?5fa383b2157306c9fb7e */ -(()=>{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);i.r(n);var a={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>a[e]=()=>r[e]));return a.default=()=>r,i.d(n,a),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>\\"chunks/\\"+e+\\".\\"+e+\\".js?f8ce81df71858f19a9f9\\",i.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",i.l=(e,t,n,a)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(s.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},i.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+\\"\\");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),i.p=e+\\"../\\"})(),(()=>{var e={255:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),u=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),a=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+a+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=a,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[a,u,c]=r,l=0;if(a.some((t=>0!==e[t]))){for(o in u)i.o(u,o)&&(i.m[o]=u[o]);if(c)c(i)}for(t&&t(r);l{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);a.r(n);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>i[e]=()=>r[e]));return i.default=()=>r,a.d(n,i),n},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>\\"chunks/\\"+e+\\".\\"+e+\\".js?510652952c2737442823\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",a.l=(e,t,n,i)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e+\\"../\\"})(),(()=>{var e={255:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=a.p+a.u(t),u=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),i=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=i,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[i,u,c]=r,l=0;if(i.some((t=>0!==e[t]))){for(o in u)a.o(u,o)&&(a.m[o]=u[o]);if(c)c(a)}for(t&&t(r);l{var r={787:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(787)})();", - "filename/two.js.LICENSE.txt?07bb88ef9fee40634e95": "/** + "filename/two.js.LICENSE.txt?c2de68244fb79db06f32": "/** * Information. * @license MIT */ ", - "filename/two.js?07bb88ef9fee40634e95": "/*! For license information please see two.js.LICENSE.txt?07bb88ef9fee40634e95 */ + "filename/two.js?c2de68244fb79db06f32": "/*! For license information please see two.js.LICENSE.txt?c2de68244fb79db06f32 */ (()=>{var r={353:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(353)})();", } `; @@ -5678,14 +5678,14 @@ Object { /** @license Copyright 2112 Moon. **/ ", - "chunks/627.627.js?f8ce81df71858f19a9f9": "/*! License information can be found in chunks/627.627.js.LICENSE.txt?query=&filebase=627.627.js */ + "chunks/627.627.js?510652952c2737442823": "/*! License information can be found in chunks/627.627.js.LICENSE.txt?query=&filebase=627.627.js */ (self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", "filename/four.js.LICENSE.txt?query=&filebase=four.js": "/** * Duplicate comment in difference files. * @license MIT */ ", - "filename/four.js?20530c418358196c3ed3": "/*! License information can be found in filename/four.js.LICENSE.txt?query=&filebase=four.js */ + "filename/four.js?3998f0a55467e3aebd7b": "/*! License information can be found in filename/four.js.LICENSE.txt?query=&filebase=four.js */ (()=>{var r={712:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(712)})();", "filename/one.js.LICENSE.txt?query=&filebase=one.js": "/*! Legal Comment */ @@ -5705,8 +5705,8 @@ Object { // @lic ", - "filename/one.js?5fa383b2157306c9fb7e": "/*! License information can be found in filename/one.js.LICENSE.txt?query=&filebase=one.js */ -(()=>{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);i.r(n);var a={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>a[e]=()=>r[e]));return a.default=()=>r,i.d(n,a),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>\\"chunks/\\"+e+\\".\\"+e+\\".js?f8ce81df71858f19a9f9\\",i.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",i.l=(e,t,n,a)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(s.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},i.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+\\"\\");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),i.p=e+\\"../\\"})(),(()=>{var e={255:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),u=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),a=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+a+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=a,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[a,u,c]=r,l=0;if(a.some((t=>0!==e[t]))){for(o in u)i.o(u,o)&&(i.m[o]=u[o]);if(c)c(i)}for(t&&t(r);l{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);a.r(n);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>i[e]=()=>r[e]));return i.default=()=>r,a.d(n,i),n},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>\\"chunks/\\"+e+\\".\\"+e+\\".js?510652952c2737442823\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",a.l=(e,t,n,i)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e+\\"../\\"})(),(()=>{var e={255:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=a.p+a.u(t),u=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),i=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=i,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[i,u,c]=r,l=0;if(i.some((t=>0!==e[t]))){for(o in u)a.o(u,o)&&(a.m[o]=u[o]);if(c)c(a)}for(t&&t(r);l{var r={787:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(787)})();", "filename/two.js.LICENSE.txt?query=&filebase=two.js": "/** * Information. * @license MIT */ ", - "filename/two.js?07bb88ef9fee40634e95": "/*! License information can be found in filename/two.js.LICENSE.txt?query=&filebase=two.js */ + "filename/two.js?c2de68244fb79db06f32": "/*! License information can be found in filename/two.js.LICENSE.txt?query=&filebase=two.js */ (()=>{var r={353:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(353)})();", } `; @@ -5739,14 +5739,14 @@ Object { /** @license Copyright 2112 Moon. **/ ", - "chunks/627.627.js?f8ce81df71858f19a9f9": "/*! For license information please see 627.627.js.LICENSE.txt */ + "chunks/627.627.js?510652952c2737442823": "/*! For license information please see 627.627.js.LICENSE.txt */ (self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[627],{627:e=>{e.exports=Math.random()}}]);", "filename/four.js.LICENSE.txt": "/** * Duplicate comment in difference files. * @license MIT */ ", - "filename/four.js?20530c418358196c3ed3": "/*! For license information please see four.js.LICENSE.txt */ + "filename/four.js?3998f0a55467e3aebd7b": "/*! For license information please see four.js.LICENSE.txt */ (()=>{var r={712:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(712)})();", "filename/one.js.LICENSE.txt": "/*! Legal Comment */ @@ -5766,8 +5766,8 @@ Object { // @lic ", - "filename/one.js?5fa383b2157306c9fb7e": "/*! For license information please see one.js.LICENSE.txt */ -(()=>{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},a={};function i(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);i.r(n);var a={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>a[e]=()=>r[e]));return a.default=()=>r,i.d(n,a),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>\\"chunks/\\"+e+\\".\\"+e+\\".js?f8ce81df71858f19a9f9\\",i.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",i.l=(e,t,n,a)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(s.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},i.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+\\"\\");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),i.p=e+\\"../\\"})(),(()=>{var e={255:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),u=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),a=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+a+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=a,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[a,u,c]=r,l=0;if(a.some((t=>0!==e[t]))){for(o in u)i.o(u,o)&&(i.m[o]=u[o]);if(c)c(i)}for(t&&t(r);l{var e,t,r,o,n={900:(e,t,r)=>{r.e(627).then(r.t.bind(r,627,23)),e.exports=Math.random()}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return n[e](r,r.exports,a),r.exports}a.m=n,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if(\\"object\\"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&\\"function\\"==typeof r.then)return r}var n=Object.create(null);a.r(n);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&o&&r;\\"object\\"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=>i[e]=()=>r[e]));return i.default=()=>r,a.d(n,i),n},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,r)=>(a.f[r](e,t),t)),[])),a.u=e=>\\"chunks/\\"+e+\\".\\"+e+\\".js?510652952c2737442823\\",a.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r={},o=\\"terser-webpack-plugin:\\",a.l=(e,t,n,i)=>{if(r[e])r[e].push(t);else{var u,c;if(void 0!==n)for(var l=document.getElementsByTagName(\\"script\\"),p=0;p{u.onerror=u.onload=null,clearTimeout(d);var n=r[e];if(delete r[e],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach((e=>e(o))),t)return t(o)},d=setTimeout(f.bind(null,void 0,{type:\\"timeout\\",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+\\"\\");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName(\\"script\\");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),a.p=e+\\"../\\"})(),(()=>{var e={255:0};a.f.j=(t,r)=>{var o=a.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var i=a.p+a.u(t),u=new Error;a.l(i,(r=>{if(a.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&(\\"load\\"===r.type?\\"missing\\":r.type),i=r&&r.target&&r.target.src;u.message=\\"Loading chunk \\"+t+\\" failed.\\\\n(\\"+n+\\": \\"+i+\\")\\",u.name=\\"ChunkLoadError\\",u.type=n,u.request=i,o[1](u)}}),\\"chunk-\\"+t,t)}};var t=(t,r)=>{var o,n,[i,u,c]=r,l=0;if(i.some((t=>0!==e[t]))){for(o in u)a.o(u,o)&&(a.m[o]=u[o]);if(c)c(a)}for(t&&t(r);l{var r={787:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(787)})();", "filename/two.js.LICENSE.txt": "/** * Information. * @license MIT */ ", - "filename/two.js?07bb88ef9fee40634e95": "/*! For license information please see two.js.LICENSE.txt */ + "filename/two.js?c2de68244fb79db06f32": "/*! For license information please see two.js.LICENSE.txt */ (()=>{var r={353:r=>{r.exports=Math.random()}},t={};(function o(e){var a=t[e];if(void 0!==a)return a.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports})(353)})();", } `; diff --git a/test/__snapshots__/minify-option.test.js.snap b/test/__snapshots__/minify-option.test.js.snap index 754509a..7857692 100644 --- a/test/__snapshots__/minify-option.test.js.snap +++ b/test/__snapshots__/minify-option.test.js.snap @@ -141,7 +141,7 @@ exports[`minify option should work using when the \`minify\` option is \`swcMini Object { "main.js": "(()=>{var a={791:b=>{b.exports=function(){console.log(7)}}},c={};function d(e){var f=c[e];if(void 0!==f)return f.exports;var g=c[e]={exports:{}};return a[e](g,g.exports,d),g.exports}var h=d(791)})() //# sourceMappingURL=main.js.map", - "main.js.map": "{\\"version\\":3,\\"file\\":\\"main.js\\",\\"mappings\\":\\"KAAgB,CAAC,GACJ,CAAC,CAAmB,EAE3B,GAAG,CACD,CAAM,EAAK,CAAC,CAOd,CAAC,OAAO,WAAkB,CAAC,OAExB,CAAC,GAAG,CAAC,CAAS,CACvB,CAAC,CAGM,EAKO,CAAwB,aAGnB,CAAmB,CAAC,CAAQ,CAAE,CAAC,GAEpC,CAAC,CAAY,CAAG,CAAwB,CAAC,CAAQ,EACpD,EAAE,MAAmB,CAAS,GAA1B,CAAY,QACR,CAAY,CAAC,OAAO,CAG5B,GAAG,CAAC,CAAM,CAAG,CAAwB,CAAC,CAAQ,GAG7C,OAAO,YAIR,CAAmB,CAAC,CAAQ,EAAE,CAAM,CAAE,CAAM,CAAC,OAAO,CAAE,CAAmB,EAGlE,CAAM,CAAC,OAAO,CACrB,GAOE,CAAC,CAAmB,CAAG,CAAmB,CAAC,GAAG,CAElD,CAAC\\",\\"sources\\":[\\"webpack://terser-webpack-plugin/\\"],\\"sourcesContent\\":[\\"/******/ (() => { // webpackBootstrap\\\\n/******/ \\\\tvar __webpack_modules__ = ({\\\\n\\\\n/***/ 791:\\\\n/***/ ((module) => {\\\\n\\\\n// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = (/* unused pure expression or super */ null && (2 + 2));\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\\\n\\\\n/***/ })\\\\n\\\\n/******/ \\\\t});\\\\n/************************************************************************/\\\\n/******/ \\\\t// The module cache\\\\n/******/ \\\\tvar __webpack_module_cache__ = {};\\\\n/******/ \\\\t\\\\n/******/ \\\\t// The require function\\\\n/******/ \\\\tfunction __webpack_require__(moduleId) {\\\\n/******/ \\\\t\\\\t// Check if module is in cache\\\\n/******/ \\\\t\\\\tvar cachedModule = __webpack_module_cache__[moduleId];\\\\n/******/ \\\\t\\\\tif (cachedModule !== undefined) {\\\\n/******/ \\\\t\\\\t\\\\treturn cachedModule.exports;\\\\n/******/ \\\\t\\\\t}\\\\n/******/ \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n/******/ \\\\t\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n/******/ \\\\t\\\\t\\\\t// no module.id needed\\\\n/******/ \\\\t\\\\t\\\\t// no module.loaded needed\\\\n/******/ \\\\t\\\\t\\\\texports: {}\\\\n/******/ \\\\t\\\\t};\\\\n/******/ \\\\t\\\\n/******/ \\\\t\\\\t// Execute the module function\\\\n/******/ \\\\t\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n/******/ \\\\t\\\\n/******/ \\\\t\\\\t// Return the exports of the module\\\\n/******/ \\\\t\\\\treturn module.exports;\\\\n/******/ \\\\t}\\\\n/******/ \\\\t\\\\n/************************************************************************/\\\\n/******/ \\\\t\\\\n/******/ \\\\t// startup\\\\n/******/ \\\\t// Load entry module and return exports\\\\n/******/ \\\\t// This entry module is referenced by other modules so it can't be inlined\\\\n/******/ \\\\tvar __webpack_exports__ = __webpack_require__(791);\\\\n/******/ \\\\t\\\\n/******/ })()\\\\n;\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}", + "main.js.map": "{\\"version\\":3,\\"file\\":\\"main.js\\",\\"mappings\\":\\"KAAgB,CAAC,GACJ,CAAC,CAAmB,CAAI,CAAC,GAE7B,CACD,CAAM,EAAK,CAAC,CAOd,CAAC,OAAO,CAAG,QAAQ,EAAO,CAAC,OAExB,CAAC,GAAG,CAAC,CAAS,CACvB,CAAC,CAGM,CAEI,CAGG,CAAwB,CAAG,CAAC,CAAC,UAGxB,CAAmB,CAAC,CAAQ,CAAE,CAAC,GAEpC,CAAC,CAAY,CAAG,CAAwB,CAAC,CAAQ,EACpD,EAAE,CAAmB,IAAI,CAAJ,CAAS,GAA1B,CAAY,CACf,MAAM,CAAC,CAAY,CAAC,OAAO,CAG5B,GAAG,CAAC,CAAM,CAAG,CAAwB,CAAC,CAAQ,EAAI,CAAC,OAG3C,CAAE,CAAC,CAAC,CACX,CAMD,MAAM,CAHN,CAAmB,CAAC,CAAQ,EAAE,CAAM,CAAE,CAAM,CAAC,OAAO,CAAE,CAAmB,EAGlE,CAAM,CAAC,OAAO,CACrB,GAOE,CAAC,CAAmB,CAAG,CAAmB,CAAC,GAAG,CAElD,CAAC\\",\\"sources\\":[\\"webpack://terser-webpack-plugin/\\"],\\"sourcesContent\\":[\\"/******/ (() => { // webpackBootstrap\\\\n/******/ \\\\tvar __webpack_modules__ = ({\\\\n\\\\n/***/ 791:\\\\n/***/ ((module) => {\\\\n\\\\n// foo\\\\n/* @preserve*/\\\\n// bar\\\\nconst a = (/* unused pure expression or super */ null && (2 + 2));\\\\n\\\\nmodule.exports = function Foo() {\\\\n const b = 2 + 2;\\\\n console.log(b + 1 + 2);\\\\n};\\\\n\\\\n\\\\n/***/ })\\\\n\\\\n/******/ \\\\t});\\\\n/************************************************************************/\\\\n/******/ \\\\t// The module cache\\\\n/******/ \\\\tvar __webpack_module_cache__ = {};\\\\n/******/ \\\\t\\\\n/******/ \\\\t// The require function\\\\n/******/ \\\\tfunction __webpack_require__(moduleId) {\\\\n/******/ \\\\t\\\\t// Check if module is in cache\\\\n/******/ \\\\t\\\\tvar cachedModule = __webpack_module_cache__[moduleId];\\\\n/******/ \\\\t\\\\tif (cachedModule !== undefined) {\\\\n/******/ \\\\t\\\\t\\\\treturn cachedModule.exports;\\\\n/******/ \\\\t\\\\t}\\\\n/******/ \\\\t\\\\t// Create a new module (and put it into the cache)\\\\n/******/ \\\\t\\\\tvar module = __webpack_module_cache__[moduleId] = {\\\\n/******/ \\\\t\\\\t\\\\t// no module.id needed\\\\n/******/ \\\\t\\\\t\\\\t// no module.loaded needed\\\\n/******/ \\\\t\\\\t\\\\texports: {}\\\\n/******/ \\\\t\\\\t};\\\\n/******/ \\\\t\\\\n/******/ \\\\t\\\\t// Execute the module function\\\\n/******/ \\\\t\\\\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\\\\n/******/ \\\\t\\\\n/******/ \\\\t\\\\t// Return the exports of the module\\\\n/******/ \\\\t\\\\treturn module.exports;\\\\n/******/ \\\\t}\\\\n/******/ \\\\t\\\\n/************************************************************************/\\\\n/******/ \\\\t\\\\n/******/ \\\\t// startup\\\\n/******/ \\\\t// Load entry module and return exports\\\\n/******/ \\\\t// This entry module is referenced by other modules so it can't be inlined\\\\n/******/ \\\\tvar __webpack_exports__ = __webpack_require__(791);\\\\n/******/ \\\\t\\\\n/******/ })()\\\\n;\\"],\\"names\\":[],\\"sourceRoot\\":\\"\\"}", } `; diff --git a/test/__snapshots__/test-option.test.js.snap b/test/__snapshots__/test-option.test.js.snap index 53cc81e..45ce5aa 100644 --- a/test/__snapshots__/test-option.test.js.snap +++ b/test/__snapshots__/test-option.test.js.snap @@ -2,11 +2,11 @@ exports[`test option should match snapshot and uglify "mjs": assets 1`] = ` Object { - "598.598.mjs?ver=f95c5682e60516749bf2": "\\"use strict\\";(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", - "AsyncImportExport.mjs?var=f95c5682e60516749bf2": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".mjs?ver=\\"+n.h(),n.h=()=>\\"f95c5682e60516749bf2\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,u;if(void 0!==i)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),u&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)u(n)}for(r&&r(t);c{console.log(\\"Good\\")}))})();", - "importExport.mjs?var=f95c5682e60516749bf2": "(()=>{\\"use strict\\";function o(){const o=\`baz\${Math.random()}\`;return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", - "js.mjs?var=f95c5682e60516749bf2": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", - "mjs.mjs?var=f95c5682e60516749bf2": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "598.598.mjs?ver=4283025c0f29bfe8ad76": "\\"use strict\\";(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.mjs?var=4283025c0f29bfe8ad76": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".mjs?ver=\\"+n.h(),n.h=()=>\\"4283025c0f29bfe8ad76\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,u;if(void 0!==i)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),u&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)u(n)}for(r&&r(t);c{console.log(\\"Good\\")}))})();", + "importExport.mjs?var=4283025c0f29bfe8ad76": "(()=>{\\"use strict\\";function o(){const o=\`baz\${Math.random()}\`;return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", + "js.mjs?var=4283025c0f29bfe8ad76": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", + "mjs.mjs?var=4283025c0f29bfe8ad76": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; @@ -16,7 +16,7 @@ exports[`test option should match snapshot and uglify "mjs": warnings 1`] = `Arr exports[`test option should match snapshot for a single "test" value ({String}): assets 1`] = ` Object { - "598.598.js?ver=5be5c7dee7e609657b1c": "\\"use strict\\"; + "598.598.js?ver=7d61999e3c19b72a22b2": "\\"use strict\\"; (self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: @@ -32,7 +32,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ @@ -100,7 +100,7 @@ __webpack_require__.r(__webpack_exports__); /******/ /******/ /* webpack/runtime/getFullHash */ /******/ (() => { -/******/ __webpack_require__.h = () => (\\"5be5c7dee7e609657b1c\\") +/******/ __webpack_require__.h = () => (\\"7d61999e3c19b72a22b2\\") /******/ })(); /******/ /******/ /* webpack/runtime/global */ @@ -297,7 +297,7 @@ __webpack_require__.e(/* import() */ 598).then(__webpack_require__.bind(__webpac /******/ })() ;", - "importExport.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "importExport.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; @@ -328,8 +328,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=5be5c7dee7e609657b1c": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", - "mjs.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "js.js?var=7d61999e3c19b72a22b2": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", + "mjs.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; // foo @@ -356,7 +356,7 @@ exports[`test option should match snapshot for a single "test" value ({String}): exports[`test option should match snapshot for a single \`test\` value ({RegExp}): assets 1`] = ` Object { - "598.598.js?ver=5be5c7dee7e609657b1c": "\\"use strict\\"; + "598.598.js?ver=7d61999e3c19b72a22b2": "\\"use strict\\"; (self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: @@ -372,7 +372,7 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; /******/ var __webpack_modules__ = ({}); /************************************************************************/ @@ -440,7 +440,7 @@ __webpack_require__.r(__webpack_exports__); /******/ /******/ /* webpack/runtime/getFullHash */ /******/ (() => { -/******/ __webpack_require__.h = () => (\\"5be5c7dee7e609657b1c\\") +/******/ __webpack_require__.h = () => (\\"7d61999e3c19b72a22b2\\") /******/ })(); /******/ /******/ /* webpack/runtime/global */ @@ -637,7 +637,7 @@ __webpack_require__.e(/* import() */ 598).then(__webpack_require__.bind(__webpac /******/ })() ;", - "importExport.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "importExport.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; @@ -668,8 +668,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=5be5c7dee7e609657b1c": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", - "mjs.js?var=5be5c7dee7e609657b1c": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "js.js?var=7d61999e3c19b72a22b2": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", + "mjs.js?var=7d61999e3c19b72a22b2": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; @@ -679,7 +679,7 @@ exports[`test option should match snapshot for a single \`test\` value ({RegExp} exports[`test option should match snapshot for multiple "test" values ({RegExp}): assets 1`] = ` Object { - "598.598.js?ver=5be5c7dee7e609657b1c": "\\"use strict\\"; + "598.598.js?ver=7d61999e3c19b72a22b2": "\\"use strict\\"; (self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: @@ -695,8 +695,8 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=5be5c7dee7e609657b1c": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"5be5c7dee7e609657b1c\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,c;if(void 0!==i)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),c&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,c]=t,u=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(c)c(n)}for(r&&r(t);u{console.log(\\"Good\\")}))})();", - "importExport.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=7d61999e3c19b72a22b2": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"7d61999e3c19b72a22b2\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,u;if(void 0!==i)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),u&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)u(n)}for(r&&r(t);c{console.log(\\"Good\\")}))})();", + "importExport.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; @@ -727,8 +727,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=5be5c7dee7e609657b1c": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", - "mjs.js?var=5be5c7dee7e609657b1c": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "js.js?var=7d61999e3c19b72a22b2": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", + "mjs.js?var=7d61999e3c19b72a22b2": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; @@ -738,7 +738,7 @@ exports[`test option should match snapshot for multiple "test" values ({RegExp}) exports[`test option should match snapshot for multiple "test" values ({String}): assets 1`] = ` Object { - "598.598.js?ver=5be5c7dee7e609657b1c": "\\"use strict\\"; + "598.598.js?ver=7d61999e3c19b72a22b2": "\\"use strict\\"; (self[\\"webpackChunkterser_webpack_plugin\\"] = self[\\"webpackChunkterser_webpack_plugin\\"] || []).push([[598],{ /***/ 598: @@ -754,8 +754,8 @@ __webpack_require__.r(__webpack_exports__); /***/ }) }]);", - "AsyncImportExport.js?var=5be5c7dee7e609657b1c": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"5be5c7dee7e609657b1c\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,c;if(void 0!==i)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),c&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,c]=t,u=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(c)c(n)}for(r&&r(t);u{console.log(\\"Good\\")}))})();", - "importExport.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "AsyncImportExport.js?var=7d61999e3c19b72a22b2": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"7d61999e3c19b72a22b2\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,u;if(void 0!==i)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),u&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)u(n)}for(r&&r(t);c{console.log(\\"Good\\")}))})();", + "importExport.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; @@ -786,8 +786,8 @@ console.log(Foo()); /******/ })() ;", - "js.js?var=5be5c7dee7e609657b1c": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", - "mjs.js?var=5be5c7dee7e609657b1c": "/******/ (() => { // webpackBootstrap + "js.js?var=7d61999e3c19b72a22b2": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", + "mjs.js?var=7d61999e3c19b72a22b2": "/******/ (() => { // webpackBootstrap /******/ \\"use strict\\"; var __webpack_exports__ = {}; // foo @@ -814,11 +814,11 @@ exports[`test option should match snapshot for multiple "test" values ({String}) exports[`test option should match snapshot with empty value: assets 1`] = ` Object { - "598.598.js?ver=5be5c7dee7e609657b1c": "\\"use strict\\";(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", - "AsyncImportExport.js?var=5be5c7dee7e609657b1c": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"5be5c7dee7e609657b1c\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,c;if(void 0!==i)for(var u=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),c&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,c]=t,u=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(c)c(n)}for(r&&r(t);u{console.log(\\"Good\\")}))})();", - "importExport.js?var=5be5c7dee7e609657b1c": "(()=>{\\"use strict\\";function o(){const o=\`baz\${Math.random()}\`;return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", - "js.js?var=5be5c7dee7e609657b1c": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", - "mjs.js?var=5be5c7dee7e609657b1c": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", + "598.598.js?ver=7d61999e3c19b72a22b2": "\\"use strict\\";(self.webpackChunkterser_webpack_plugin=self.webpackChunkterser_webpack_plugin||[]).push([[598],{598:(e,s,p)=>{p.r(s),p.d(s,{default:()=>c});const c=\\"async-dep\\"}}]);", + "AsyncImportExport.js?var=7d61999e3c19b72a22b2": "(()=>{\\"use strict\\";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+\\".\\"+e+\\".js?ver=\\"+n.h(),n.h=()=>\\"7d61999e3c19b72a22b2\\",n.g=function(){if(\\"object\\"==typeof globalThis)return globalThis;try{return this||new Function(\\"return this\\")()}catch(e){if(\\"object\\"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r=\\"terser-webpack-plugin:\\",n.l=(t,o,i,a)=>{if(e[t])e[t].push(o);else{var l,u;if(void 0!==i)for(var c=document.getElementsByTagName(\\"script\\"),s=0;s{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:\\"timeout\\",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),u&&document.head.appendChild(l)}},n.r=e=>{\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+\\"\\");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName(\\"script\\");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error(\\"Automatic publicPath is not supported in this browser\\");e=e.replace(/#.*$/,\\"\\").replace(/\\\\?.*$/,\\"\\").replace(/\\\\/[^\\\\/]+$/,\\"/\\"),n.p=e})(),(()=>{var e={988:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&(\\"load\\"===t.type?\\"missing\\":t.type),a=t&&t.target&&t.target.src;l.message=\\"Loading chunk \\"+r+\\" failed.\\\\n(\\"+i+\\": \\"+a+\\")\\",l.name=\\"ChunkLoadError\\",l.type=i,l.request=a,o[1](l)}}),\\"chunk-\\"+r,r)}};var r=(r,t)=>{var o,i,[a,l,u]=t,c=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(u)u(n)}for(r&&r(t);c{console.log(\\"Good\\")}))})();", + "importExport.js?var=7d61999e3c19b72a22b2": "(()=>{\\"use strict\\";function o(){const o=\`baz\${Math.random()}\`;return()=>({a:\\"foobar\\"+o,b:\\"foo\\",baz:o})}console.log(o())})();", + "js.js?var=7d61999e3c19b72a22b2": "(()=>{var r={791:r=>{r.exports=function(){console.log(7)}}},o={};(function t(e){var n=o[e];if(void 0!==n)return n.exports;var s=o[e]={exports:{}};return r[e](s,s.exports,t),s.exports})(791)})();", + "mjs.js?var=7d61999e3c19b72a22b2": "(()=>{\\"use strict\\";function o(){console.log(11)}o(),module.exports=o})();", } `; diff --git a/test/__snapshots__/validate-options.test.js.snap b/test/__snapshots__/validate-options.test.js.snap index cc01f41..70346ed 100644 --- a/test/__snapshots__/validate-options.test.js.snap +++ b/test/__snapshots__/validate-options.test.js.snap @@ -129,7 +129,7 @@ exports[`validation 10`] = ` "Invalid options object. Terser Plugin has been initialized using an options object that does not match the API schema. - options.terserOptions should be an object: object { … } - -> Options for \`terser\`. + -> Options for \`terser\` (by default) or custom \`minify\` function. -> Read more at https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions" `; diff --git a/types/cjs.d.ts b/types/cjs.d.ts new file mode 100644 index 0000000..2cb80fb --- /dev/null +++ b/types/cjs.d.ts @@ -0,0 +1,3 @@ +declare const _exports: typeof plugin.default; +export = _exports; +import plugin = require("./index"); diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..b01a1a3 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,300 @@ +export default TerserPlugin; +export type Schema = import("schema-utils/declarations/validate").Schema; +export type Compiler = import("webpack").Compiler; +export type Compilation = import("webpack").Compilation; +export type WebpackError = import("webpack").WebpackError; +export type Asset = import("webpack").Asset; +export type TerserECMA = import("terser").ECMA; +export type TerserMinifyOptions = import("terser").MinifyOptions; +export type UglifyJSMinifyOptions = import("uglify-js").MinifyOptions; +export type SwcMinifyOptions = import("@swc/core").JsMinifyOptions; +export type EsbuildMinifyOptions = import("esbuild").TransformOptions; +export type CustomMinifyOptions = any; +export type JestWorker = import("jest-worker").Worker; +export type RawSourceMap = import("source-map").RawSourceMap; +export type Rule = RegExp | string; +export type Rules = Rule[] | Rule; +export type ExtractCommentsFunction = ( + astNode: any, + comment: { + value: string; + type: "comment1" | "comment2" | "comment3" | "comment4"; + pos: number; + line: number; + col: number; + } +) => boolean; +export type ExtractCommentsCondition = + | boolean + | "all" + | "some" + | RegExp + | ExtractCommentsFunction; +export type ExtractCommentsFilename = string | ((fileData: any) => string); +export type ExtractCommentsBanner = + | string + | boolean + | ((commentsFile: string) => string); +export type ExtractCommentsObject = { + condition: ExtractCommentsCondition; + filename: ExtractCommentsFilename; + banner: ExtractCommentsBanner; +}; +export type ExtractCommentsOptions = + | ExtractCommentsCondition + | ExtractCommentsObject; +export type Input = { + [file: string]: string; +}; +export type MinifyResult = { + code: string; + map?: import("source-map").RawSourceMap | undefined; + errors?: (string | Error)[] | undefined; + warnings?: (string | Error)[] | undefined; + extractedComments?: string[] | undefined; +}; +export type InternalPredefinedMinimizerOptions = { + module?: boolean | undefined; + ecma?: 5 | 2020 | 2015 | 2016 | 2017 | 2018 | 2019 | undefined; +}; +export type InternalMinifyOptions = { + name: string; + input: string; + inputSourceMap: RawSourceMap | undefined; + extractComments: ExtractCommentsOptions | undefined; + minify: MinifyFunction; + minifyOptions: InternalPredefinedMinimizerOptions & T; +}; +export type MinifyWorker = Worker & { + transform: (options: string) => MinifyResult; + minify: (options: InternalMinifyOptions) => MinifyResult; +}; +export type MinifyFunction = ( + input: Input, + sourceMap: RawSourceMap | undefined, + minifyOptions: InternalPredefinedMinimizerOptions & T, + extractComments: ExtractCommentsOptions | undefined +) => Promise; +export type TerserMinifyFunction = MinifyFunction; +export type UglifyJSMinifyFunction = MinifyFunction; +export type SwcMinifyFunction = MinifyFunction; +export type EsbuildMinifyFunction = MinifyFunction; +export type CustomMinifyFunction = MinifyFunction; +export type BasePluginOptions = { + test?: Rules | undefined; + include?: Rules | undefined; + exclude?: Rules | undefined; + extractComments?: ExtractCommentsOptions | undefined; + parallel?: boolean | undefined; +}; +export type ThirdArgument = T extends ( + arg1: any, + arg2: any, + arg3: infer U, + ...args: any[] +) => any + ? U + : never; +export type DefaultPluginOptions = { + terserOptions?: import("terser").MinifyOptions | undefined; + minify?: undefined; +}; +export type PickMinifyOptions = T extends infer Z + ? ThirdArgument extends never + ? any + : { + minify?: Z | undefined; + terserOptions?: ThirdArgument | undefined; + } + : DefaultPluginOptions; +/** @typedef {import("schema-utils/declarations/validate").Schema} Schema */ +/** @typedef {import("webpack").Compiler} Compiler */ +/** @typedef {import("webpack").Compilation} Compilation */ +/** @typedef {import("webpack").WebpackError} WebpackError */ +/** @typedef {import("webpack").Asset} Asset */ +/** @typedef {import("terser").ECMA} TerserECMA */ +/** @typedef {import("terser").MinifyOptions} TerserMinifyOptions */ +/** @typedef {import("uglify-js").MinifyOptions} UglifyJSMinifyOptions */ +/** @typedef {import("@swc/core").JsMinifyOptions} SwcMinifyOptions */ +/** @typedef {import("esbuild").TransformOptions} EsbuildMinifyOptions */ +/** @typedef {Object.} CustomMinifyOptions */ +/** @typedef {import("jest-worker").Worker} JestWorker */ +/** @typedef {import("source-map").RawSourceMap} RawSourceMap */ +/** @typedef {RegExp | string} Rule */ +/** @typedef {Rule[] | Rule} Rules */ +/** + * @callback ExtractCommentsFunction + * @param {any} astNode + * @param {{ value: string, type: 'comment1' | 'comment2' | 'comment3' | 'comment4', pos: number, line: number, col: number }} comment + * @returns {boolean} + */ +/** + * @typedef {boolean | 'all' | 'some' | RegExp | ExtractCommentsFunction} ExtractCommentsCondition + */ +/** + * @typedef {string | ((fileData: any) => string)} ExtractCommentsFilename + */ +/** + * @typedef {boolean | string | ((commentsFile: string) => string)} ExtractCommentsBanner + */ +/** + * @typedef {Object} ExtractCommentsObject + * @property {ExtractCommentsCondition} condition + * @property {ExtractCommentsFilename} filename + * @property {ExtractCommentsBanner} banner + */ +/** + * @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions + */ +/** + * @typedef {{ [file: string]: string }} Input + */ +/** + * @typedef {Object} MinifyResult + * @property {string} code + * @property {RawSourceMap} [map] + * @property {Array} [errors] + * @property {Array} [warnings] + * @property {Array} [extractedComments] + */ +/** + * @typedef {Object} InternalPredefinedMinimizerOptions + * @property {boolean} [module] + * @property {5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020} [ecma] + */ +/** + * @template T + * @typedef {Object} InternalMinifyOptions + * @property {string} name + * @property {string} input + * @property {RawSourceMap | undefined} inputSourceMap + * @property {ExtractCommentsOptions | undefined} extractComments + * @property {MinifyFunction} minify + * @property {InternalPredefinedMinimizerOptions & T} minifyOptions + */ +/** + * @template T + * @typedef {JestWorker & { transform: (options: string) => MinifyResult, minify: (options: InternalMinifyOptions) => MinifyResult }} MinifyWorker + */ +/** + * @template T + * @callback MinifyFunction + * @param {Input} input + * @param {RawSourceMap | undefined} sourceMap + * @param {InternalPredefinedMinimizerOptions & T} minifyOptions + * @param {ExtractCommentsOptions | undefined} extractComments + * @returns {Promise} + */ +/** + * @typedef {MinifyFunction} TerserMinifyFunction + */ +/** + * @typedef {MinifyFunction} UglifyJSMinifyFunction + */ +/** + * @typedef {MinifyFunction} SwcMinifyFunction + */ +/** + * @typedef {MinifyFunction} EsbuildMinifyFunction + */ +/** + * @typedef {MinifyFunction} CustomMinifyFunction + */ +/** + * @typedef {Object} BasePluginOptions + * @property {Rules} [test] + * @property {Rules} [include] + * @property {Rules} [exclude] + * @property {ExtractCommentsOptions} [extractComments] + * @property {boolean} [parallel] + */ +/** + * @template T + * @typedef {T extends (arg1: any, arg2: any, arg3: infer U, ...args: any[]) => any ? U: never} ThirdArgument + */ +/** + * @typedef {Object} DefaultPluginOptions + * @property {TerserMinifyOptions} [terserOptions] + * @property {undefined} [minify] + */ +/** + * @template T + * @typedef {T extends infer Z ? ThirdArgument extends never ? any : { minify?: Z; terserOptions?: ThirdArgument } : DefaultPluginOptions} PickMinifyOptions + */ +/** + * @template {TerserMinifyFunction | UglifyJSMinifyFunction | SwcMinifyFunction | EsbuildMinifyFunction | CustomMinifyFunction} T =TerserMinifyFunction + */ +declare class TerserPlugin< + T extends + | TerserMinifyFunction + | UglifyJSMinifyFunction + | SwcMinifyFunction + | EsbuildMinifyFunction + | CustomMinifyFunction = TerserMinifyFunction +> { + /** + * @private + * @param {any} input + * @returns {boolean} + */ + private static isSourceMap; + /** + * @private + * @param {Error & { line: number, col: number}} error + * @param {string} file + * @param {Compilation["requestShortener"]} [requestShortener] + * @param {SourceMapConsumer} [sourceMap] + * @returns {Error} + */ + private static buildError; + /** + * @private + * @param {boolean | undefined} parallel + * @returns {number} + */ + private static getAvailableNumberOfCores; + /** + * @private + * @param {any} environment + * @returns {TerserECMA} + */ + private static getEcmaVersion; + /** + * @param {BasePluginOptions & PickMinifyOptions} [options] + */ + constructor(options?: (BasePluginOptions & PickMinifyOptions) | undefined); + options: { + test: any; + extractComments: any; + parallel: any; + include: any; + exclude: any; + minify: any; + terserOptions: any; + }; + /** + * @private + * @param {Compiler} compiler + * @param {Compilation} compilation + * @param {Record} assets + * @param {{availableNumberOfCores: number}} optimizeOptions + * @returns {Promise} + */ + private optimize; + /** + * @param {Compiler} compiler + * @returns {void} + */ + apply(compiler: Compiler): void; +} +declare namespace TerserPlugin { + export { terserMinify }; + export { uglifyJsMinify }; + export { swcMinify }; + export { esbuildMinify }; +} +import { Worker } from "jest-worker"; +import { terserMinify } from "./utils"; +import { uglifyJsMinify } from "./utils"; +import { swcMinify } from "./utils"; +import { esbuildMinify } from "./utils"; diff --git a/types/minify.d.ts b/types/minify.d.ts new file mode 100644 index 0000000..f858256 --- /dev/null +++ b/types/minify.d.ts @@ -0,0 +1,15 @@ +export type MinifyResult = import("./index.js").MinifyResult; +/** @typedef {import("./index.js").MinifyResult} MinifyResult */ +/** + * @template T + * @param {import("./index.js").InternalMinifyOptions} options + * @returns {Promise} + */ +export function minify( + options: import("./index.js").InternalMinifyOptions +): Promise; +/** + * @param {string} options + * @returns {Promise} + */ +export function transform(options: string): Promise; diff --git a/types/utils.d.ts b/types/utils.d.ts new file mode 100644 index 0000000..0facaad --- /dev/null +++ b/types/utils.d.ts @@ -0,0 +1,115 @@ +export type RawSourceMap = import("source-map").RawSourceMap; +export type TerserMinifyOptions = import("terser").MinifyOptions; +export type TerserFormatOptions = import("terser").FormatOptions; +export type UglifyJSMinifyOptions = import("uglify-js").MinifyOptions; +export type UglifyJSOutputOptions = import("uglify-js").OutputOptions; +export type SwcMinifyOptions = import("@swc/core").JsMinifyOptions; +export type EsbuildMinifyOptions = import("esbuild").TransformOptions; +export type ExtractCommentsOptions = + import("./index.js").ExtractCommentsOptions; +export type ExtractCommentsFunction = + import("./index.js").ExtractCommentsFunction; +export type ExtractCommentsCondition = + import("./index.js").ExtractCommentsCondition; +export type Input = import("./index.js").Input; +export type MinifyResult = import("./index.js").MinifyResult; +export type InternalPredefinedMinimizerOptions = + import("./index.js").InternalPredefinedMinimizerOptions; +export type NormalizedTerserMinifyOptions = TerserMinifyOptions & { + sourceMap: undefined; +} & ( + | { + output: TerserFormatOptions & { + beautify: boolean; + }; + } + | { + format: TerserFormatOptions & { + beautify: boolean; + }; + } + ); +export type NormalizedUglifyJSMinifyOptions = UglifyJSMinifyOptions & { + sourceMap: undefined; +} & { + output: UglifyJSOutputOptions & { + beautify: boolean; + }; +}; +export type NormalizedSwcMinifyOptions = SwcMinifyOptions & { + sourceMap: undefined; +}; +export type ExtractedComments = Array; +/** @typedef {import("source-map").RawSourceMap} RawSourceMap */ +/** @typedef {import("terser").MinifyOptions} TerserMinifyOptions */ +/** @typedef {import("terser").FormatOptions} TerserFormatOptions */ +/** @typedef {import("uglify-js").MinifyOptions} UglifyJSMinifyOptions */ +/** @typedef {import("uglify-js").OutputOptions} UglifyJSOutputOptions */ +/** @typedef {import("@swc/core").JsMinifyOptions} SwcMinifyOptions */ +/** @typedef {import("esbuild").TransformOptions} EsbuildMinifyOptions */ +/** @typedef {import("./index.js").ExtractCommentsOptions} ExtractCommentsOptions */ +/** @typedef {import("./index.js").ExtractCommentsFunction} ExtractCommentsFunction */ +/** @typedef {import("./index.js").ExtractCommentsCondition} ExtractCommentsCondition */ +/** @typedef {import("./index.js").Input} Input */ +/** @typedef {import("./index.js").MinifyResult} MinifyResult */ +/** @typedef {import("./index.js").InternalPredefinedMinimizerOptions} InternalPredefinedMinimizerOptions */ +/** + * @typedef {TerserMinifyOptions & { sourceMap: undefined } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })} NormalizedTerserMinifyOptions + */ +/** + * @typedef {UglifyJSMinifyOptions & { sourceMap: undefined } & { output: UglifyJSOutputOptions & { beautify: boolean } }} NormalizedUglifyJSMinifyOptions + */ +/** + * @typedef {SwcMinifyOptions & { sourceMap: undefined }} NormalizedSwcMinifyOptions + */ +/** + * @typedef {Array} ExtractedComments + */ +/** + * @param {Input} input + * @param {RawSourceMap | undefined} sourceMap + * @param {InternalPredefinedMinimizerOptions & TerserMinifyOptions} minimizerOptions + * @param {ExtractCommentsOptions | undefined} extractComments + * @return {Promise} + */ +export function terserMinify( + input: Input, + sourceMap: RawSourceMap | undefined, + minimizerOptions: InternalPredefinedMinimizerOptions & TerserMinifyOptions, + extractComments: ExtractCommentsOptions | undefined +): Promise; +/** + * @param {Input} input + * @param {RawSourceMap | undefined} sourceMap + * @param {InternalPredefinedMinimizerOptions & UglifyJSMinifyOptions} minimizerOptions + * @param {ExtractCommentsOptions | undefined} extractComments + * @return {Promise} + */ +export function uglifyJsMinify( + input: Input, + sourceMap: RawSourceMap | undefined, + minimizerOptions: InternalPredefinedMinimizerOptions & UglifyJSMinifyOptions, + extractComments: ExtractCommentsOptions | undefined +): Promise; +/** + * @param {Input} input + * @param {RawSourceMap | undefined} sourceMap + * @param {InternalPredefinedMinimizerOptions & SwcMinifyOptions} minimizerOptions + * @return {Promise} + */ +export function swcMinify( + input: Input, + sourceMap: RawSourceMap | undefined, + minimizerOptions: InternalPredefinedMinimizerOptions & SwcMinifyOptions +): Promise; +/** + * @param {Input} input + * @param {RawSourceMap | undefined} sourceMap + * @param {InternalPredefinedMinimizerOptions & EsbuildMinifyOptions} minimizerOptions + * @return {Promise} + */ +export function esbuildMinify( + input: Input, + sourceMap: RawSourceMap | undefined, + minimizerOptions: InternalPredefinedMinimizerOptions & EsbuildMinifyOptions +): Promise;