@rushstack/webpack5-module-minifier-plugin 5.7.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.json +52 -0
  2. package/CHANGELOG.md +15 -1
  3. package/dist/tsdoc-metadata.json +1 -1
  4. package/lib-esm/Constants.js +56 -0
  5. package/lib-esm/Constants.js.map +1 -0
  6. package/lib-esm/GenerateLicenseFileForAsset.js +47 -0
  7. package/lib-esm/GenerateLicenseFileForAsset.js.map +1 -0
  8. package/lib-esm/ModuleMinifierPlugin.js +458 -0
  9. package/lib-esm/ModuleMinifierPlugin.js.map +1 -0
  10. package/lib-esm/ModuleMinifierPlugin.types.js +4 -0
  11. package/lib-esm/ModuleMinifierPlugin.types.js.map +1 -0
  12. package/lib-esm/RehydrateAsset.js +80 -0
  13. package/lib-esm/RehydrateAsset.js.map +1 -0
  14. package/lib-esm/index.js +6 -0
  15. package/lib-esm/index.js.map +1 -0
  16. package/package.json +30 -7
  17. /package/{lib → lib-commonjs}/Constants.js +0 -0
  18. /package/{lib → lib-commonjs}/Constants.js.map +0 -0
  19. /package/{lib → lib-commonjs}/GenerateLicenseFileForAsset.js +0 -0
  20. /package/{lib → lib-commonjs}/GenerateLicenseFileForAsset.js.map +0 -0
  21. /package/{lib → lib-commonjs}/ModuleMinifierPlugin.js +0 -0
  22. /package/{lib → lib-commonjs}/ModuleMinifierPlugin.js.map +0 -0
  23. /package/{lib → lib-commonjs}/ModuleMinifierPlugin.types.js +0 -0
  24. /package/{lib → lib-commonjs}/ModuleMinifierPlugin.types.js.map +0 -0
  25. /package/{lib → lib-commonjs}/RehydrateAsset.js +0 -0
  26. /package/{lib → lib-commonjs}/RehydrateAsset.js.map +0 -0
  27. /package/{lib → lib-commonjs}/index.js +0 -0
  28. /package/{lib → lib-commonjs}/index.js.map +0 -0
  29. /package/{lib → lib-dts}/Constants.d.ts +0 -0
  30. /package/{lib → lib-dts}/Constants.d.ts.map +0 -0
  31. /package/{lib → lib-dts}/GenerateLicenseFileForAsset.d.ts +0 -0
  32. /package/{lib → lib-dts}/GenerateLicenseFileForAsset.d.ts.map +0 -0
  33. /package/{lib → lib-dts}/ModuleMinifierPlugin.d.ts +0 -0
  34. /package/{lib → lib-dts}/ModuleMinifierPlugin.d.ts.map +0 -0
  35. /package/{lib → lib-dts}/ModuleMinifierPlugin.types.d.ts +0 -0
  36. /package/{lib → lib-dts}/ModuleMinifierPlugin.types.d.ts.map +0 -0
  37. /package/{lib → lib-dts}/RehydrateAsset.d.ts +0 -0
  38. /package/{lib → lib-dts}/RehydrateAsset.d.ts.map +0 -0
  39. /package/{lib → lib-dts}/index.d.ts +0 -0
  40. /package/{lib → lib-dts}/index.d.ts.map +0 -0
package/CHANGELOG.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@rushstack/webpack5-module-minifier-plugin",
3
3
  "entries": [
4
+ {
5
+ "version": "5.8.1",
6
+ "tag": "@rushstack/webpack5-module-minifier-plugin_v5.8.1",
7
+ "date": "Fri, 20 Feb 2026 00:15:04 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "Add `\"node\"` condition before `\"import\"` in the `\"exports\"` map so that Node.js uses the CJS output (which handles extensionless imports), while bundlers still use ESM via `\"import\"`. Fixes https://github.com/microsoft/rushstack/issues/5644."
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.7.1`"
17
+ },
18
+ {
19
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.2.1`"
20
+ },
21
+ {
22
+ "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.9.1`"
23
+ },
24
+ {
25
+ "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `0.9.1`"
26
+ }
27
+ ]
28
+ }
29
+ },
30
+ {
31
+ "version": "5.8.0",
32
+ "tag": "@rushstack/webpack5-module-minifier-plugin_v5.8.0",
33
+ "date": "Thu, 19 Feb 2026 00:04:53 GMT",
34
+ "comments": {
35
+ "minor": [
36
+ {
37
+ "comment": "Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `\"exports\"` field in `package.json`."
38
+ }
39
+ ],
40
+ "dependency": [
41
+ {
42
+ "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.7.0`"
43
+ },
44
+ {
45
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.2.0`"
46
+ },
47
+ {
48
+ "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.9.0`"
49
+ },
50
+ {
51
+ "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `0.9.0`"
52
+ }
53
+ ]
54
+ }
55
+ },
4
56
  {
5
57
  "version": "5.7.0",
6
58
  "tag": "@rushstack/webpack5-module-minifier-plugin_v5.7.0",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log - @rushstack/webpack5-module-minifier-plugin
2
2
 
3
- This log was last generated on Thu, 12 Feb 2026 23:00:53 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 20 Feb 2026 00:15:04 GMT and should not be manually modified.
4
+
5
+ ## 5.8.1
6
+ Fri, 20 Feb 2026 00:15:04 GMT
7
+
8
+ ### Patches
9
+
10
+ - Add `"node"` condition before `"import"` in the `"exports"` map so that Node.js uses the CJS output (which handles extensionless imports), while bundlers still use ESM via `"import"`. Fixes https://github.com/microsoft/rushstack/issues/5644.
11
+
12
+ ## 5.8.0
13
+ Thu, 19 Feb 2026 00:04:53 GMT
14
+
15
+ ### Minor changes
16
+
17
+ - Normalize package layout. CommonJS is now under `lib-commonjs`, DTS is now under `lib-dts`, and ESM is now under `lib-esm`. Imports to `lib` still work as before, handled by the `"exports"` field in `package.json`.
4
18
 
5
19
  ## 5.7.0
6
20
  Thu, 12 Feb 2026 23:00:53 GMT
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.56.3"
8
+ "packageVersion": "7.57.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,56 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ /**
4
+ * Prefix to wrap `function (module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.
5
+ * Public because alternate Minifier implementations may wish to know about it.
6
+ * @public
7
+ */
8
+ export const MODULE_WRAPPER_PREFIX = '__MINIFY_MODULE__(';
9
+ /**
10
+ * Suffix to wrap `function (module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.
11
+ * Public because alternate Minifier implementations may wish to know about it.
12
+ * @public
13
+ */
14
+ export const MODULE_WRAPPER_SUFFIX = ');';
15
+ /**
16
+ * Prefix to wrap ECMAScript method shorthand `(module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.
17
+ * Used when webpack emits modules using shorthand syntax.
18
+ * Combined with the suffix, creates: `__MINIFY_MODULE__({__DEFAULT_ID__(params){body}});`
19
+ * Public because alternate Minifier implementations may wish to know about it.
20
+ * @public
21
+ */
22
+ export const MODULE_WRAPPER_SHORTHAND_PREFIX = `${MODULE_WRAPPER_PREFIX}{__DEFAULT_ID__`;
23
+ /**
24
+ * Suffix to wrap ECMAScript method shorthand `(module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.
25
+ * Used when webpack emits modules using shorthand syntax.
26
+ * Combined with the prefix, creates: `__MINIFY_MODULE__({__DEFAULT_ID__(params){body}});`
27
+ * Public because alternate Minifier implementations may wish to know about it.
28
+ * @public
29
+ */
30
+ export const MODULE_WRAPPER_SHORTHAND_SUFFIX = `}${MODULE_WRAPPER_SUFFIX}`;
31
+ /**
32
+ * Token preceding a module id in the emitted asset so the minifier can operate on the Webpack runtime or chunk boilerplate in isolation
33
+ * @public
34
+ */
35
+ export const CHUNK_MODULE_TOKEN = '__WEBPACK_CHUNK_MODULE__';
36
+ /**
37
+ * RegExp for replacing chunk module placeholders
38
+ * Handles three possible representations:
39
+ * - `"id":__WEBPACK_CHUNK_MODULE__HASH__` (methodShorthand: false, object)
40
+ * - `__WEBPACK_CHUNK_MODULE__HASH__` (array syntax)
41
+ * - `"id":__WEBPACK_CHUNK_MODULE__HASH__` with leading ':' (methodShorthand: true, object)
42
+ * Captures optional leading `:` to handle shorthand format properly
43
+ * @public
44
+ */
45
+ export const CHUNK_MODULE_REGEX = /(:?)__WEBPACK_CHUNK_MODULE__([A-Za-z0-9$_]+)/g;
46
+ /**
47
+ * Stage # to use when this should be the first tap in the hook
48
+ * @public
49
+ */
50
+ export const STAGE_BEFORE = -10000;
51
+ /**
52
+ * Stage # to use when this should be the last tap in the hook
53
+ * @public
54
+ */
55
+ export const STAGE_AFTER = 100;
56
+ //# sourceMappingURL=Constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../src/Constants.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAyB,oBAAoB,CAAC;AAChF;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAS,IAAI,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAqD,GAAG,qBAAqB,iBAAiB,CAAC;AAC3I;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAuC,IAAI,qBAAqB,EAAE,CAAC;AAE/G;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA+B,0BAA0B,CAAC;AAEzF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAW,+CAA+C,CAAC;AAE1F;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW,CAAC,KAAK,CAAC;AAC3C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAQ,GAAG,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Prefix to wrap `function (module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.\n * Public because alternate Minifier implementations may wish to know about it.\n * @public\n */\nexport const MODULE_WRAPPER_PREFIX: '__MINIFY_MODULE__(' = '__MINIFY_MODULE__(';\n/**\n * Suffix to wrap `function (module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.\n * Public because alternate Minifier implementations may wish to know about it.\n * @public\n */\nexport const MODULE_WRAPPER_SUFFIX: ');' = ');';\n\n/**\n * Prefix to wrap ECMAScript method shorthand `(module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.\n * Used when webpack emits modules using shorthand syntax.\n * Combined with the suffix, creates: `__MINIFY_MODULE__({__DEFAULT_ID__(params){body}});`\n * Public because alternate Minifier implementations may wish to know about it.\n * @public\n */\nexport const MODULE_WRAPPER_SHORTHAND_PREFIX: `${typeof MODULE_WRAPPER_PREFIX}{__DEFAULT_ID__` = `${MODULE_WRAPPER_PREFIX}{__DEFAULT_ID__`;\n/**\n * Suffix to wrap ECMAScript method shorthand `(module, __webpack_exports__, __webpack_require__) { ... }` so that the minifier doesn't delete it.\n * Used when webpack emits modules using shorthand syntax.\n * Combined with the prefix, creates: `__MINIFY_MODULE__({__DEFAULT_ID__(params){body}});`\n * Public because alternate Minifier implementations may wish to know about it.\n * @public\n */\nexport const MODULE_WRAPPER_SHORTHAND_SUFFIX: `}${typeof MODULE_WRAPPER_SUFFIX}` = `}${MODULE_WRAPPER_SUFFIX}`;\n\n/**\n * Token preceding a module id in the emitted asset so the minifier can operate on the Webpack runtime or chunk boilerplate in isolation\n * @public\n */\nexport const CHUNK_MODULE_TOKEN: '__WEBPACK_CHUNK_MODULE__' = '__WEBPACK_CHUNK_MODULE__';\n\n/**\n * RegExp for replacing chunk module placeholders\n * Handles three possible representations:\n * - `\"id\":__WEBPACK_CHUNK_MODULE__HASH__` (methodShorthand: false, object)\n * - `__WEBPACK_CHUNK_MODULE__HASH__` (array syntax)\n * - `\"id\":__WEBPACK_CHUNK_MODULE__HASH__` with leading ':' (methodShorthand: true, object)\n * Captures optional leading `:` to handle shorthand format properly\n * @public\n */\nexport const CHUNK_MODULE_REGEX: RegExp = /(:?)__WEBPACK_CHUNK_MODULE__([A-Za-z0-9$_]+)/g;\n\n/**\n * Stage # to use when this should be the first tap in the hook\n * @public\n */\nexport const STAGE_BEFORE: -10000 = -10000;\n/**\n * Stage # to use when this should be the last tap in the hook\n * @public\n */\nexport const STAGE_AFTER: 100 = 100;\n"]}
@@ -0,0 +1,47 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import * as path from 'node:path';
4
+ function getAllComments(modules) {
5
+ var _a;
6
+ const allComments = new Set();
7
+ for (const webpackModule of modules) {
8
+ const submodules = (webpackModule.context === null &&
9
+ webpackModule._modules) || [webpackModule];
10
+ for (const submodule of submodules) {
11
+ const subModuleComments = (_a = submodule.factoryMeta) === null || _a === void 0 ? void 0 : _a.comments;
12
+ if (subModuleComments) {
13
+ for (const comment of subModuleComments) {
14
+ const value = comment.type === 'Line' ? `//${comment.value}\n` : `/*${comment.value}*/\n`;
15
+ allComments.add(value);
16
+ }
17
+ }
18
+ }
19
+ }
20
+ return allComments;
21
+ }
22
+ /**
23
+ * Generates a companion asset containing all extracted comments. If it is non-empty, returns a banner comment directing users to said companion asset.
24
+ *
25
+ * @param compilation - The webpack compilation
26
+ * @param asset - The asset to process
27
+ * @public
28
+ */
29
+ export function generateLicenseFileForAsset(compilation, asset) {
30
+ // Extracted comments from the modules.
31
+ const modules = compilation.chunkGraph.getChunkModulesIterable(asset.chunk);
32
+ const comments = getAllComments(modules);
33
+ const assetName = asset.fileName;
34
+ let banner = '';
35
+ if (comments.size) {
36
+ // There are license comments in this chunk, so generate the companion file and inject a banner
37
+ const licenseSource = new compilation.compiler.webpack.sources.ConcatSource();
38
+ comments.forEach((comment) => {
39
+ licenseSource.add(comment);
40
+ });
41
+ const licenseFileName = `${assetName}.LICENSE.txt`;
42
+ compilation.emitAsset(licenseFileName, licenseSource);
43
+ banner = `/*! For license information please see ${path.basename(licenseFileName)} */\n`;
44
+ }
45
+ return banner;
46
+ }
47
+ //# sourceMappingURL=GenerateLicenseFileForAsset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerateLicenseFileForAsset.js","sourceRoot":"","sources":["../src/GenerateLicenseFileForAsset.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAOlC,SAAS,cAAc,CAAC,OAAyB;;IAC/C,MAAM,WAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;IAE3C,KAAK,MAAM,aAAa,IAAI,OAAO,EAAE,CAAC;QACpC,MAAM,UAAU,GAAqB,CAAC,aAAa,CAAC,OAAO,KAAK,IAAI;YACjE,aAAiD,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAClF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,iBAAiB,GAAkC,MACvD,SAAS,CAAC,WAGX,0CAAE,QAAQ,CAAC;YAEZ,IAAI,iBAAiB,EAAE,CAAC;gBACtB,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;oBACxC,MAAM,KAAK,GAAW,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,KAAK,MAAM,CAAC;oBAClG,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,WAAwB,EAAE,KAAiB;IACrF,uCAAuC;IACvC,MAAM,OAAO,GAAqB,WAAW,CAAC,UAAU,CAAC,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9F,MAAM,QAAQ,GAAgB,cAAc,CAAC,OAAO,CAAC,CAAC;IAEtD,MAAM,SAAS,GAAW,KAAK,CAAC,QAAQ,CAAC;IAEzC,IAAI,MAAM,GAAW,EAAE,CAAC;IAExB,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;QAClB,+FAA+F;QAC/F,MAAM,aAAa,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QACpG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,MAAM,eAAe,GAAW,GAAG,SAAS,cAAc,CAAC;QAC3D,WAAW,CAAC,SAAS,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;QACtD,MAAM,GAAG,0CAA0C,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC;IAC3F,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'node:path';\n\nimport type { Comment } from 'estree';\nimport type { Compilation, Module, sources } from 'webpack';\n\nimport type { IAssetInfo } from './ModuleMinifierPlugin.types';\n\nfunction getAllComments(modules: Iterable<Module>): Set<string> {\n const allComments: Set<string> = new Set();\n\n for (const webpackModule of modules) {\n const submodules: Iterable<Module> = (webpackModule.context === null &&\n (webpackModule as { _modules?: Iterable<Module> })._modules) || [webpackModule];\n for (const submodule of submodules) {\n const subModuleComments: Iterable<Comment> | undefined = (\n submodule.factoryMeta as {\n comments?: Iterable<Comment>;\n }\n )?.comments;\n\n if (subModuleComments) {\n for (const comment of subModuleComments) {\n const value: string = comment.type === 'Line' ? `//${comment.value}\\n` : `/*${comment.value}*/\\n`;\n allComments.add(value);\n }\n }\n }\n }\n\n return allComments;\n}\n\n/**\n * Generates a companion asset containing all extracted comments. If it is non-empty, returns a banner comment directing users to said companion asset.\n *\n * @param compilation - The webpack compilation\n * @param asset - The asset to process\n * @public\n */\nexport function generateLicenseFileForAsset(compilation: Compilation, asset: IAssetInfo): string {\n // Extracted comments from the modules.\n const modules: Iterable<Module> = compilation.chunkGraph.getChunkModulesIterable(asset.chunk);\n const comments: Set<string> = getAllComments(modules);\n\n const assetName: string = asset.fileName;\n\n let banner: string = '';\n\n if (comments.size) {\n // There are license comments in this chunk, so generate the companion file and inject a banner\n const licenseSource: sources.ConcatSource = new compilation.compiler.webpack.sources.ConcatSource();\n comments.forEach((comment) => {\n licenseSource.add(comment);\n });\n const licenseFileName: string = `${assetName}.LICENSE.txt`;\n compilation.emitAsset(licenseFileName, licenseSource);\n banner = `/*! For license information please see ${path.basename(licenseFileName)} */\\n`;\n }\n\n return banner;\n}\n"]}
@@ -0,0 +1,458 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { createHash } from 'node:crypto';
4
+ import { AsyncSeriesWaterfallHook, SyncWaterfallHook } from 'tapable';
5
+ import { getIdentifier } from '@rushstack/module-minifier';
6
+ import { CHUNK_MODULE_TOKEN, MODULE_WRAPPER_PREFIX, MODULE_WRAPPER_SUFFIX, MODULE_WRAPPER_SHORTHAND_PREFIX, MODULE_WRAPPER_SHORTHAND_SUFFIX, STAGE_BEFORE, STAGE_AFTER } from './Constants';
7
+ import { generateLicenseFileForAsset } from './GenerateLicenseFileForAsset';
8
+ import { rehydrateAsset } from './RehydrateAsset';
9
+ // The name of the plugin, for use in taps
10
+ const PLUGIN_NAME = 'ModuleMinifierPlugin';
11
+ // Monotonically increasing identifier to be incremented any time the code generation logic changes
12
+ // Will be applied to the webpack hash.
13
+ const CODE_GENERATION_REVISION = 1;
14
+ // Match behavior of terser's "some" option
15
+ // https://github.com/terser/terser/blob/d3d924fa9e4c57bbe286b811c6068bcc7026e902/lib/output.js#L175
16
+ const LICENSE_COMMENT_REGEX = /@preserve|@lic|@cc_on|^\**!/i;
17
+ const TAP_BEFORE = {
18
+ name: PLUGIN_NAME,
19
+ stage: STAGE_BEFORE
20
+ };
21
+ const TAP_AFTER = {
22
+ name: PLUGIN_NAME,
23
+ stage: STAGE_AFTER
24
+ };
25
+ const compilationMetadataMap = new WeakMap();
26
+ function hashCodeFragment(code) {
27
+ return createHash('sha256').update(code).digest('hex');
28
+ }
29
+ /**
30
+ * Base implementation of asset rehydration
31
+ *
32
+ * @param dehydratedAssets The dehydrated assets
33
+ * @param compilation The webpack compilation
34
+ */
35
+ function defaultRehydrateAssets(dehydratedAssets, compilation) {
36
+ const { assets, modules } = dehydratedAssets;
37
+ const compilationMetadata = compilationMetadataMap.get(compilation);
38
+ if (!compilationMetadata) {
39
+ throw new Error(`Could not get compilation metadata`);
40
+ }
41
+ const { metadataByAssetFileName } = compilationMetadata;
42
+ // Now assets/modules contain fully minified code. Rehydrate.
43
+ for (const [assetName, info] of assets) {
44
+ const banner = info.type === 'javascript' ? generateLicenseFileForAsset(compilation, info) : '';
45
+ const replacementSource = rehydrateAsset(compilation, info, modules, banner, true);
46
+ metadataByAssetFileName.set(assetName, {
47
+ positionByModuleId: info.renderInfo
48
+ });
49
+ compilation.updateAsset(assetName, replacementSource);
50
+ }
51
+ return dehydratedAssets;
52
+ }
53
+ function isMinificationResultError(result) {
54
+ return !!result.error;
55
+ }
56
+ function isLicenseComment(comment) {
57
+ return LICENSE_COMMENT_REGEX.test(comment.value);
58
+ }
59
+ /**
60
+ * RegExp for detecting function keyword with optional whitespace
61
+ */
62
+ const FUNCTION_KEYWORD_REGEX = /function\s*\(/;
63
+ /**
64
+ * Detects if the module code uses ECMAScript method shorthand format.
65
+ * Shorthand format would appear when webpack emits object methods without function keyword
66
+ * For example: `id(params) { body }` instead of `id: function(params) { body }`
67
+ *
68
+ * Following the problem statement's recommendation: inspect the rendered code prior to the first `{`
69
+ * and look for either a `=>` or `function(`. If neither are encountered, assume object shorthand format.
70
+ *
71
+ * @param code - The module source code to check
72
+ * @returns true if the code is in method shorthand format
73
+ */
74
+ function isMethodShorthandFormat(code) {
75
+ // Find the position of the first opening brace
76
+ const firstBraceIndex = code.indexOf('{');
77
+ if (firstBraceIndex < 0) {
78
+ // No brace found, not a function format
79
+ return false;
80
+ }
81
+ // Get the code before the first brace
82
+ const beforeBrace = code.slice(0, firstBraceIndex);
83
+ // Check if it contains '=>' or 'function('
84
+ // If it does, it's a regular arrow function or function expression, not shorthand
85
+ // Use a simple check that handles common whitespace variations
86
+ if (beforeBrace.includes('=>') || FUNCTION_KEYWORD_REGEX.test(beforeBrace)) {
87
+ return false;
88
+ }
89
+ // If neither '=>' nor 'function(' are found, assume object method shorthand format
90
+ // ECMAScript method shorthand is used in object literals: { methodName(params){body} }
91
+ // Webpack emits this as just (params){body} which only works in the object literal context
92
+ return true;
93
+ }
94
+ /**
95
+ * Webpack plugin that minifies code on a per-module basis rather than per-asset. The actual minification is handled by the input `minifier` object.
96
+ * @public
97
+ */
98
+ export class ModuleMinifierPlugin {
99
+ constructor(options) {
100
+ this.hooks = {
101
+ rehydrateAssets: new AsyncSeriesWaterfallHook(['dehydratedContent', 'compilation']),
102
+ postProcessCodeFragment: new SyncWaterfallHook(['code', 'context'])
103
+ };
104
+ const { minifier, sourceMap } = options;
105
+ this._optionsForHash = {
106
+ ...options,
107
+ minifier: undefined,
108
+ revision: CODE_GENERATION_REVISION
109
+ };
110
+ this._enhancers = [];
111
+ this.hooks.rehydrateAssets.tap(PLUGIN_NAME, defaultRehydrateAssets);
112
+ this.minifier = minifier;
113
+ this._sourceMap = sourceMap;
114
+ }
115
+ static getCompilationStatistics(compilation) {
116
+ return compilationMetadataMap.get(compilation);
117
+ }
118
+ apply(compiler) {
119
+ for (const enhancer of this._enhancers) {
120
+ enhancer.apply(compiler);
121
+ }
122
+ const { options: { devtool, mode }, webpack } = compiler;
123
+ webpack.Template.numberToIdentifier = getIdentifier;
124
+ const { CachedSource, ConcatSource, RawSource, ReplaceSource, SourceMapSource } = webpack.sources;
125
+ // The explicit setting is preferred due to accuracy, but try to guess based on devtool
126
+ const useSourceMaps = typeof this._sourceMap === 'boolean'
127
+ ? this._sourceMap
128
+ : typeof devtool === 'string'
129
+ ? devtool.endsWith('source-map')
130
+ : mode === 'production' && devtool !== false;
131
+ this._optionsForHash.sourceMap = useSourceMaps;
132
+ const binaryConfig = Buffer.from(JSON.stringify(this._optionsForHash), 'utf-8');
133
+ compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation, compilationData) => {
134
+ const { normalModuleFactory } = compilationData;
135
+ function addCommentExtraction(parser) {
136
+ parser.hooks.program.tap(PLUGIN_NAME, (program, comments) => {
137
+ const relevantComments = comments.filter(isLicenseComment);
138
+ if (comments.length > 0) {
139
+ // Webpack's typings now restrict the properties on factoryMeta for unknown reasons
140
+ const module = parser.state.module;
141
+ if (!module.factoryMeta) {
142
+ module.factoryMeta = {
143
+ comments: relevantComments
144
+ };
145
+ }
146
+ else {
147
+ module.factoryMeta.comments = relevantComments;
148
+ }
149
+ }
150
+ });
151
+ }
152
+ normalModuleFactory.hooks.parser.for('javascript/auto').tap(PLUGIN_NAME, addCommentExtraction);
153
+ normalModuleFactory.hooks.parser.for('javascript/dynamic').tap(PLUGIN_NAME, addCommentExtraction);
154
+ normalModuleFactory.hooks.parser.for('javascript/esm').tap(PLUGIN_NAME, addCommentExtraction);
155
+ /**
156
+ * Set of local module ids that have been processed.
157
+ */
158
+ const submittedModules = new Set();
159
+ /**
160
+ * The text and comments of all minified modules.
161
+ */
162
+ const minifiedModules = new Map();
163
+ /**
164
+ * The text and comments of all minified chunks. Most of these are trivial, but the runtime chunk is a bit larger.
165
+ */
166
+ const minifiedAssets = new Map();
167
+ const metadataByModule = new WeakMap();
168
+ const metadataByAssetFileName = new Map();
169
+ const compilationStatistics = {
170
+ metadataByModule,
171
+ metadataByAssetFileName
172
+ };
173
+ compilationMetadataMap.set(compilation, compilationStatistics);
174
+ function getOrCreateMetadata(mod) {
175
+ let moduleStats = metadataByModule.get(mod);
176
+ if (!moduleStats) {
177
+ moduleStats = {
178
+ hashByChunk: new Map(),
179
+ sizeByHash: new Map()
180
+ };
181
+ metadataByModule.set(mod, moduleStats);
182
+ }
183
+ return moduleStats;
184
+ }
185
+ let pendingMinificationRequests = 0;
186
+ /**
187
+ * Indicates that all files have been sent to the minifier and therefore that when pending hits 0, assets can be rehydrated.
188
+ */
189
+ let allRequestsIssued = false;
190
+ let resolveMinifyPromise;
191
+ const postProcessCode = (code, context) => this.hooks.postProcessCodeFragment.call(code, context);
192
+ /**
193
+ * Callback to invoke when a file has finished minifying.
194
+ */
195
+ function onFileMinified() {
196
+ if (--pendingMinificationRequests === 0 && allRequestsIssued) {
197
+ resolveMinifyPromise();
198
+ }
199
+ }
200
+ const { minifier } = this;
201
+ let minifierConnection;
202
+ // Typings for this object are not exposed
203
+ // eslint-disable-next-line @typescript-eslint/typedef
204
+ const javascriptHooks = webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);
205
+ /**
206
+ * The minifier needs to know if the module was wrapped in a factory function, because
207
+ * function (module, exports, require) { // <implementation> }
208
+ * minifies to nothing. Unfortunately we can't tell by inspection if the output was wrapped or not.
209
+ * However, the JavaScriptModulesPlugin invokes three hooks in order when rendering a module:
210
+ * 1) renderModuleContent - Invoked for every module.
211
+ * 2) renderModuleContainer - Invoked when wrapping a module in a factory.
212
+ * 3) renderModulePackage - Invoked for every module as the last hook.
213
+ */
214
+ let nextModule;
215
+ const sourceCache = new WeakMap();
216
+ javascriptHooks.renderModuleContent.tap(TAP_AFTER, (source) => {
217
+ // Clear the identification state of the current module.
218
+ nextModule = undefined;
219
+ return source;
220
+ });
221
+ javascriptHooks.renderModuleContainer.tap(TAP_AFTER, (source, mod) => {
222
+ // Module is being wrapped in a factory, so it is safe for per-module minification
223
+ // Leave external modules in-place to avoid needing special handling for externals
224
+ if (mod.context !== null || !mod.externalType) {
225
+ nextModule = mod;
226
+ }
227
+ return source;
228
+ });
229
+ javascriptHooks.renderModulePackage.tap(TAP_AFTER,
230
+ /**
231
+ * Extracts the code for the module and sends it to be minified.
232
+ */
233
+ function minifyModule(source, mod, chunkRenderContext) {
234
+ if (nextModule !== mod) {
235
+ // This module is being inlined. Abandon per-module minification.
236
+ return source;
237
+ }
238
+ const id = compilation.chunkGraph.getModuleId(mod);
239
+ if (id === null) {
240
+ // This module has no id. Abandon per-module minification.
241
+ return source;
242
+ }
243
+ const metadata = getOrCreateMetadata(mod);
244
+ const cachedResult = sourceCache.get(source);
245
+ if (cachedResult) {
246
+ metadata.hashByChunk.set(chunkRenderContext.chunk, cachedResult.hash);
247
+ return cachedResult.source;
248
+ }
249
+ // Get the source code to check its format
250
+ const sourceCode = source.source().toString();
251
+ // Detect if this is ECMAScript method shorthand format
252
+ const isShorthand = isMethodShorthandFormat(sourceCode);
253
+ // If this module is wrapped in a factory, need to add boilerplate so that the minifier keeps the function
254
+ const wrapped = isShorthand
255
+ ? new ConcatSource(MODULE_WRAPPER_SHORTHAND_PREFIX, source, MODULE_WRAPPER_SHORTHAND_SUFFIX)
256
+ : new ConcatSource(MODULE_WRAPPER_PREFIX + '\n', source, '\n' + MODULE_WRAPPER_SUFFIX);
257
+ const nameForMap = `(modules)/${id}`;
258
+ const { source: wrappedCodeRaw, map } = useSourceMaps
259
+ ? wrapped.sourceAndMap()
260
+ : {
261
+ source: wrapped.source(),
262
+ map: undefined
263
+ };
264
+ const wrappedCode = wrappedCodeRaw.toString();
265
+ const hash = hashCodeFragment(wrappedCode);
266
+ metadata.hashByChunk.set(chunkRenderContext.chunk, hash);
267
+ if (!submittedModules.has(hash)) {
268
+ submittedModules.add(hash);
269
+ ++pendingMinificationRequests;
270
+ minifier.minify({
271
+ hash,
272
+ code: wrappedCode,
273
+ nameForMap: useSourceMaps ? nameForMap : undefined,
274
+ externals: undefined
275
+ }, (result) => {
276
+ if (isMinificationResultError(result)) {
277
+ compilation.errors.push(result.error);
278
+ }
279
+ else {
280
+ try {
281
+ const { code: minified, map: minifierMap } = result;
282
+ const rawOutput = useSourceMaps
283
+ ? new SourceMapSource(minified, // Code
284
+ nameForMap, // File
285
+ minifierMap, // Base source map
286
+ wrappedCode, // Source from before transform
287
+ map, // Source Map from before transform
288
+ true // Remove original source
289
+ )
290
+ : new RawSource(minified);
291
+ const unwrapped = new ReplaceSource(rawOutput);
292
+ const len = minified.length;
293
+ // Trim off the boilerplate used to preserve the factory
294
+ // Use different prefix/suffix lengths for shorthand vs regular format
295
+ // Capture isShorthand from closure instead of looking it up
296
+ if (isShorthand) {
297
+ // For shorthand format: __MINIFY_MODULE__({__DEFAULT_ID__(args){...}});
298
+ // Remove prefix and suffix by their lengths
299
+ unwrapped.replace(0, MODULE_WRAPPER_SHORTHAND_PREFIX.length - 1, '');
300
+ unwrapped.replace(len - MODULE_WRAPPER_SHORTHAND_SUFFIX.length, len - 1, '');
301
+ }
302
+ else {
303
+ // Regular format: __MINIFY_MODULE__(function(args){...}); or __MINIFY_MODULE__((args)=>{...});
304
+ unwrapped.replace(0, MODULE_WRAPPER_PREFIX.length - 1, '');
305
+ unwrapped.replace(len - MODULE_WRAPPER_SUFFIX.length, len - 1, '');
306
+ }
307
+ const withIds = postProcessCode(unwrapped, {
308
+ compilation,
309
+ module: mod,
310
+ loggingName: mod.identifier()
311
+ });
312
+ const cached = new CachedSource(withIds);
313
+ const minifiedSize = Buffer.byteLength(cached.source(), 'utf-8');
314
+ metadata.sizeByHash.set(hash, minifiedSize);
315
+ minifiedModules.set(hash, {
316
+ source: cached,
317
+ module: mod,
318
+ id,
319
+ isShorthand
320
+ });
321
+ }
322
+ catch (err) {
323
+ compilation.errors.push(err);
324
+ }
325
+ }
326
+ onFileMinified();
327
+ });
328
+ }
329
+ // Create token with optional ':' prefix for shorthand modules
330
+ // For non-shorthand: __WEBPACK_CHUNK_MODULE__hash (becomes "id":__WEBPACK_CHUNK_MODULE__hash in object)
331
+ // For shorthand: :__WEBPACK_CHUNK_MODULE__hash (becomes "id"__WEBPACK_CHUNK_MODULE__hash, ':' makes it valid property assignment)
332
+ const tokenPrefix = isShorthand ? ':' : '';
333
+ const result = new RawSource(`${tokenPrefix}${CHUNK_MODULE_TOKEN}${hash}`);
334
+ sourceCache.set(source, {
335
+ hash,
336
+ source: result,
337
+ isShorthand
338
+ });
339
+ // Return an expression to replace later
340
+ return result;
341
+ });
342
+ // The optimizeChunkModules hook is the last async hook that occurs before chunk rendering
343
+ compilation.hooks.optimizeChunkModules.tapPromise(PLUGIN_NAME, async () => {
344
+ minifierConnection = await minifier.connectAsync();
345
+ submittedModules.clear();
346
+ });
347
+ const isJSAsset = /\.[cm]?js(\?.+)?$/;
348
+ // This should happen before any other tasks that operate during processAssets
349
+ compilation.hooks.processAssets.tapPromise(TAP_BEFORE, async () => {
350
+ const { chunkGraph, chunks } = compilation;
351
+ // Still need to minify the rendered assets
352
+ for (const chunk of chunks) {
353
+ const allChunkModules = chunkGraph.getChunkModulesIterableBySourceType(chunk, 'javascript');
354
+ if (!allChunkModules) {
355
+ // This chunk does not contain javascript modules
356
+ continue;
357
+ }
358
+ for (const assetName of chunk.files) {
359
+ const asset = compilation.assets[assetName];
360
+ // Verify that this is a JS asset
361
+ if (isJSAsset.test(assetName)) {
362
+ ++pendingMinificationRequests;
363
+ const { source: wrappedCodeRaw, map } = useSourceMaps
364
+ ? asset.sourceAndMap()
365
+ : {
366
+ source: asset.source(),
367
+ map: undefined
368
+ };
369
+ const rawCode = wrappedCodeRaw.toString();
370
+ const nameForMap = `(chunks)/${assetName}`;
371
+ const hash = hashCodeFragment(rawCode);
372
+ minifier.minify({
373
+ hash,
374
+ code: rawCode,
375
+ nameForMap: useSourceMaps ? nameForMap : undefined,
376
+ externals: undefined
377
+ }, (result) => {
378
+ if (isMinificationResultError(result)) {
379
+ compilation.errors.push(result.error);
380
+ // eslint-disable-next-line no-console
381
+ console.error(result.error);
382
+ }
383
+ else {
384
+ try {
385
+ const { code: minified, map: minifierMap } = result;
386
+ const rawOutput = useSourceMaps
387
+ ? new SourceMapSource(minified, // Code
388
+ nameForMap, // File
389
+ minifierMap !== null && minifierMap !== void 0 ? minifierMap : undefined, // Base source map
390
+ rawCode, // Source from before transform
391
+ map !== null && map !== void 0 ? map : undefined, // Source Map from before transform
392
+ true // Remove original source
393
+ )
394
+ : new RawSource(minified);
395
+ const withIds = postProcessCode(new ReplaceSource(rawOutput), {
396
+ compilation,
397
+ module: undefined,
398
+ loggingName: assetName
399
+ });
400
+ minifiedAssets.set(assetName, {
401
+ source: new CachedSource(withIds),
402
+ chunk,
403
+ fileName: assetName,
404
+ renderInfo: new Map(),
405
+ type: 'javascript'
406
+ });
407
+ }
408
+ catch (err) {
409
+ compilation.errors.push(err);
410
+ }
411
+ }
412
+ onFileMinified();
413
+ });
414
+ }
415
+ else {
416
+ // This isn't a JS asset. Don't try to minify the asset wrapper, though if it contains modules, those might still get replaced with minified versions.
417
+ minifiedAssets.set(assetName, {
418
+ // Still need to restore ids
419
+ source: postProcessCode(new ReplaceSource(asset), {
420
+ compilation,
421
+ module: undefined,
422
+ loggingName: assetName
423
+ }),
424
+ chunk,
425
+ fileName: assetName,
426
+ renderInfo: new Map(),
427
+ type: 'unknown'
428
+ });
429
+ }
430
+ }
431
+ }
432
+ allRequestsIssued = true;
433
+ if (pendingMinificationRequests) {
434
+ await new Promise((resolve) => {
435
+ resolveMinifyPromise = resolve;
436
+ });
437
+ }
438
+ // Handle any error from the minifier.
439
+ await (minifierConnection === null || minifierConnection === void 0 ? void 0 : minifierConnection.disconnectAsync());
440
+ // All assets and modules have been minified, hand them off to be rehydrated
441
+ await this.hooks.rehydrateAssets.promise({
442
+ assets: minifiedAssets,
443
+ modules: minifiedModules
444
+ }, compilation);
445
+ });
446
+ // Need to update chunk hashes with information from this plugin
447
+ javascriptHooks.chunkHash.tap(PLUGIN_NAME, (chunk, hash) => {
448
+ // Apply the options hash
449
+ hash.update(binaryConfig);
450
+ // Apply the hash from the minifier
451
+ if (minifierConnection) {
452
+ hash.update(minifierConnection.configHash, 'utf8');
453
+ }
454
+ });
455
+ });
456
+ }
457
+ }
458
+ //# sourceMappingURL=ModuleMinifierPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleMinifierPlugin.js","sourceRoot":"","sources":["../src/ModuleMinifierPlugin.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAczC,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAY,MAAM,SAAS,CAAC;AAQhF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,+BAA+B,EAC/B,+BAA+B,EAC/B,YAAY,EACZ,WAAW,EACZ,MAAM,aAAa,CAAC;AAarB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,0CAA0C;AAC1C,MAAM,WAAW,GAA2B,sBAAsB,CAAC;AAEnE,mGAAmG;AACnG,uCAAuC;AACvC,MAAM,wBAAwB,GAAW,CAAC,CAAC;AAC3C,2CAA2C;AAC3C,oGAAoG;AACpG,MAAM,qBAAqB,GAAW,8BAA8B,CAAC;AAErE,MAAM,UAAU,GAAQ;IACtB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;CACpB,CAAC;AACF,MAAM,SAAS,GAAQ;IACrB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;CACnB,CAAC;AAaF,MAAM,sBAAsB,GAA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1B,mCAAmC;gBACnC,IAAI,kBAAkB,EAAE,CAAC;oBACvB,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;gBACrD,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { createHash } from 'node:crypto';\n\nimport type { Comment } from 'estree';\nimport type {\n Module,\n Compilation,\n WebpackPluginInstance,\n Compiler,\n javascript,\n WebpackError,\n ExternalModule,\n sources,\n Chunk\n} from 'webpack';\nimport { AsyncSeriesWaterfallHook, SyncWaterfallHook, type Tap } from 'tapable';\n\nimport type {\n IMinifierConnection,\n IModuleMinifier,\n IModuleMinificationResult,\n IModuleMinificationErrorResult\n} from '@rushstack/module-minifier';\nimport { getIdentifier } from '@rushstack/module-minifier';\n\nimport {\n CHUNK_MODULE_TOKEN,\n MODULE_WRAPPER_PREFIX,\n MODULE_WRAPPER_SUFFIX,\n MODULE_WRAPPER_SHORTHAND_PREFIX,\n MODULE_WRAPPER_SHORTHAND_SUFFIX,\n STAGE_BEFORE,\n STAGE_AFTER\n} from './Constants';\nimport type {\n IModuleMinifierPluginOptions,\n IModuleMap,\n IAssetMap,\n IFactoryMeta,\n IModuleMinifierPluginHooks,\n IPostProcessFragmentContext,\n IDehydratedAssets,\n IModuleStats,\n IModuleMinifierPluginStats as IModuleMinifierPluginStats,\n IAssetStats\n} from './ModuleMinifierPlugin.types';\nimport { generateLicenseFileForAsset } from './GenerateLicenseFileForAsset';\nimport { rehydrateAsset } from './RehydrateAsset';\n\n// The name of the plugin, for use in taps\nconst PLUGIN_NAME: 'ModuleMinifierPlugin' = 'ModuleMinifierPlugin';\n\n// Monotonically increasing identifier to be incremented any time the code generation logic changes\n// Will be applied to the webpack hash.\nconst CODE_GENERATION_REVISION: number = 1;\n// Match behavior of terser's \"some\" option\n// https://github.com/terser/terser/blob/d3d924fa9e4c57bbe286b811c6068bcc7026e902/lib/output.js#L175\nconst LICENSE_COMMENT_REGEX: RegExp = /@preserve|@lic|@cc_on|^\\**!/i;\n\nconst TAP_BEFORE: Tap = {\n name: PLUGIN_NAME,\n stage: STAGE_BEFORE\n};\nconst TAP_AFTER: Tap = {\n name: PLUGIN_NAME,\n stage: STAGE_AFTER\n};\n\ninterface IOptionsForHash extends Omit<IModuleMinifierPluginOptions, 'minifier'> {\n revision: number;\n minifier: undefined;\n}\n\ninterface ISourceCacheEntry {\n source: sources.Source;\n hash: string;\n isShorthand: boolean;\n}\n\nconst compilationMetadataMap: WeakMap<Compilation, IModuleMinifierPluginStats> = new WeakMap();\n\nfunction hashCodeFragment(code: string): string {\n return createHash('sha256').update(code).digest('hex');\n}\n\n/**\n * Base implementation of asset rehydration\n *\n * @param dehydratedAssets The dehydrated assets\n * @param compilation The webpack compilation\n */\nfunction defaultRehydrateAssets(\n dehydratedAssets: IDehydratedAssets,\n compilation: Compilation\n): IDehydratedAssets {\n const { assets, modules } = dehydratedAssets;\n\n const compilationMetadata: IModuleMinifierPluginStats | undefined = compilationMetadataMap.get(compilation);\n if (!compilationMetadata) {\n throw new Error(`Could not get compilation metadata`);\n }\n\n const { metadataByAssetFileName } = compilationMetadata;\n\n // Now assets/modules contain fully minified code. Rehydrate.\n for (const [assetName, info] of assets) {\n const banner: string = info.type === 'javascript' ? generateLicenseFileForAsset(compilation, info) : '';\n\n const replacementSource: sources.Source = rehydrateAsset(compilation, info, modules, banner, true);\n metadataByAssetFileName.set(assetName, {\n positionByModuleId: info.renderInfo\n });\n compilation.updateAsset(assetName, replacementSource);\n }\n\n return dehydratedAssets;\n}\n\nfunction isMinificationResultError(\n result: IModuleMinificationResult\n): result is IModuleMinificationErrorResult {\n return !!result.error;\n}\n\nfunction isLicenseComment(comment: Comment): boolean {\n return LICENSE_COMMENT_REGEX.test(comment.value);\n}\n\n/**\n * RegExp for detecting function keyword with optional whitespace\n */\nconst FUNCTION_KEYWORD_REGEX: RegExp = /function\\s*\\(/;\n\n/**\n * Detects if the module code uses ECMAScript method shorthand format.\n * Shorthand format would appear when webpack emits object methods without function keyword\n * For example: `id(params) { body }` instead of `id: function(params) { body }`\n *\n * Following the problem statement's recommendation: inspect the rendered code prior to the first `{`\n * and look for either a `=>` or `function(`. If neither are encountered, assume object shorthand format.\n *\n * @param code - The module source code to check\n * @returns true if the code is in method shorthand format\n */\nfunction isMethodShorthandFormat(code: string): boolean {\n // Find the position of the first opening brace\n const firstBraceIndex: number = code.indexOf('{');\n if (firstBraceIndex < 0) {\n // No brace found, not a function format\n return false;\n }\n\n // Get the code before the first brace\n const beforeBrace: string = code.slice(0, firstBraceIndex);\n\n // Check if it contains '=>' or 'function('\n // If it does, it's a regular arrow function or function expression, not shorthand\n // Use a simple check that handles common whitespace variations\n if (beforeBrace.includes('=>') || FUNCTION_KEYWORD_REGEX.test(beforeBrace)) {\n return false;\n }\n\n // If neither '=>' nor 'function(' are found, assume object method shorthand format\n // ECMAScript method shorthand is used in object literals: { methodName(params){body} }\n // Webpack emits this as just (params){body} which only works in the object literal context\n return true;\n}\n\n/**\n * Webpack plugin that minifies code on a per-module basis rather than per-asset. The actual minification is handled by the input `minifier` object.\n * @public\n */\nexport class ModuleMinifierPlugin implements WebpackPluginInstance {\n public readonly hooks: IModuleMinifierPluginHooks;\n public minifier: IModuleMinifier;\n\n private readonly _enhancers: WebpackPluginInstance[];\n private readonly _sourceMap: boolean | undefined;\n\n private readonly _optionsForHash: IOptionsForHash;\n\n public constructor(options: IModuleMinifierPluginOptions) {\n this.hooks = {\n rehydrateAssets: new AsyncSeriesWaterfallHook(['dehydratedContent', 'compilation']),\n\n postProcessCodeFragment: new SyncWaterfallHook(['code', 'context'])\n };\n\n const { minifier, sourceMap } = options;\n\n this._optionsForHash = {\n ...options,\n minifier: undefined,\n revision: CODE_GENERATION_REVISION\n };\n\n this._enhancers = [];\n\n this.hooks.rehydrateAssets.tap(PLUGIN_NAME, defaultRehydrateAssets);\n this.minifier = minifier;\n\n this._sourceMap = sourceMap;\n }\n\n public static getCompilationStatistics(compilation: Compilation): IModuleMinifierPluginStats | undefined {\n return compilationMetadataMap.get(compilation);\n }\n\n public apply(compiler: Compiler): void {\n for (const enhancer of this._enhancers) {\n enhancer.apply(compiler);\n }\n\n const {\n options: { devtool, mode },\n webpack\n } = compiler;\n\n webpack.Template.numberToIdentifier = getIdentifier;\n\n const { CachedSource, ConcatSource, RawSource, ReplaceSource, SourceMapSource } = webpack.sources;\n // The explicit setting is preferred due to accuracy, but try to guess based on devtool\n const useSourceMaps: boolean =\n typeof this._sourceMap === 'boolean'\n ? this._sourceMap\n : typeof devtool === 'string'\n ? devtool.endsWith('source-map')\n : mode === 'production' && devtool !== false;\n\n this._optionsForHash.sourceMap = useSourceMaps;\n const binaryConfig: Buffer = Buffer.from(JSON.stringify(this._optionsForHash), 'utf-8');\n\n compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation, compilationData) => {\n const { normalModuleFactory } = compilationData;\n\n function addCommentExtraction(parser: javascript.JavascriptParser): void {\n parser.hooks.program.tap(PLUGIN_NAME, (program: unknown, comments: Comment[]) => {\n const relevantComments: Comment[] = comments.filter(isLicenseComment);\n if (comments.length > 0) {\n // Webpack's typings now restrict the properties on factoryMeta for unknown reasons\n const module: { factoryMeta?: IFactoryMeta } = parser.state.module as unknown as {\n factoryMeta?: IFactoryMeta;\n };\n if (!module.factoryMeta) {\n module.factoryMeta = {\n comments: relevantComments\n };\n } else {\n (module.factoryMeta as IFactoryMeta).comments = relevantComments;\n }\n }\n });\n }\n\n normalModuleFactory.hooks.parser.for('javascript/auto').tap(PLUGIN_NAME, addCommentExtraction);\n normalModuleFactory.hooks.parser.for('javascript/dynamic').tap(PLUGIN_NAME, addCommentExtraction);\n normalModuleFactory.hooks.parser.for('javascript/esm').tap(PLUGIN_NAME, addCommentExtraction);\n\n /**\n * Set of local module ids that have been processed.\n */\n const submittedModules: Set<string | number> = new Set();\n\n /**\n * The text and comments of all minified modules.\n */\n const minifiedModules: IModuleMap = new Map();\n\n /**\n * The text and comments of all minified chunks. Most of these are trivial, but the runtime chunk is a bit larger.\n */\n const minifiedAssets: IAssetMap = new Map();\n\n const metadataByModule: WeakMap<Module, IModuleStats> = new WeakMap();\n const metadataByAssetFileName: Map<string, IAssetStats> = new Map();\n const compilationStatistics: IModuleMinifierPluginStats = {\n metadataByModule,\n metadataByAssetFileName\n };\n compilationMetadataMap.set(compilation, compilationStatistics);\n function getOrCreateMetadata(mod: Module): IModuleStats {\n let moduleStats: IModuleStats | undefined = metadataByModule.get(mod);\n if (!moduleStats) {\n moduleStats = {\n hashByChunk: new Map(),\n sizeByHash: new Map()\n };\n metadataByModule.set(mod, moduleStats);\n }\n return moduleStats;\n }\n\n let pendingMinificationRequests: number = 0;\n /**\n * Indicates that all files have been sent to the minifier and therefore that when pending hits 0, assets can be rehydrated.\n */\n let allRequestsIssued: boolean = false;\n\n let resolveMinifyPromise: () => void;\n\n const postProcessCode: (\n code: sources.ReplaceSource,\n context: IPostProcessFragmentContext\n ) => sources.ReplaceSource = (code: sources.ReplaceSource, context: IPostProcessFragmentContext) =>\n this.hooks.postProcessCodeFragment.call(code, context);\n\n /**\n * Callback to invoke when a file has finished minifying.\n */\n function onFileMinified(): void {\n if (--pendingMinificationRequests === 0 && allRequestsIssued) {\n resolveMinifyPromise();\n }\n }\n\n const { minifier } = this;\n\n let minifierConnection: IMinifierConnection | undefined;\n\n // Typings for this object are not exposed\n // eslint-disable-next-line @typescript-eslint/typedef\n const javascriptHooks = webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);\n\n /**\n * The minifier needs to know if the module was wrapped in a factory function, because\n * function (module, exports, require) { // <implementation> }\n * minifies to nothing. Unfortunately we can't tell by inspection if the output was wrapped or not.\n * However, the JavaScriptModulesPlugin invokes three hooks in order when rendering a module:\n * 1) renderModuleContent - Invoked for every module.\n * 2) renderModuleContainer - Invoked when wrapping a module in a factory.\n * 3) renderModulePackage - Invoked for every module as the last hook.\n */\n let nextModule: Module | undefined;\n const sourceCache: WeakMap<sources.Source, ISourceCacheEntry> = new WeakMap();\n javascriptHooks.renderModuleContent.tap(TAP_AFTER, (source) => {\n // Clear the identification state of the current module.\n nextModule = undefined;\n return source;\n });\n javascriptHooks.renderModuleContainer.tap(TAP_AFTER, (source, mod) => {\n // Module is being wrapped in a factory, so it is safe for per-module minification\n // Leave external modules in-place to avoid needing special handling for externals\n if (mod.context !== null || !(mod as ExternalModule).externalType) {\n nextModule = mod;\n }\n return source;\n });\n javascriptHooks.renderModulePackage.tap(\n TAP_AFTER,\n /**\n * Extracts the code for the module and sends it to be minified.\n */\n function minifyModule(\n source: sources.Source,\n mod: Module,\n chunkRenderContext: { chunk: Chunk }\n ): sources.Source {\n if (nextModule !== mod) {\n // This module is being inlined. Abandon per-module minification.\n return source;\n }\n\n const id: string | number | null = compilation.chunkGraph.getModuleId(mod);\n\n if (id === null) {\n // This module has no id. Abandon per-module minification.\n return source;\n }\n\n const metadata: IModuleStats = getOrCreateMetadata(mod);\n const cachedResult: ISourceCacheEntry | undefined = sourceCache.get(source);\n if (cachedResult) {\n metadata.hashByChunk.set(chunkRenderContext.chunk, cachedResult.hash);\n return cachedResult.source;\n }\n\n // Get the source code to check its format\n const sourceCode: string = source.source().toString();\n\n // Detect if this is ECMAScript method shorthand format\n const isShorthand: boolean = isMethodShorthandFormat(sourceCode);\n\n // If this module is wrapped in a factory, need to add boilerplate so that the minifier keeps the function\n const wrapped: sources.Source = isShorthand\n ? new ConcatSource(MODULE_WRAPPER_SHORTHAND_PREFIX, source, MODULE_WRAPPER_SHORTHAND_SUFFIX)\n : new ConcatSource(MODULE_WRAPPER_PREFIX + '\\n', source, '\\n' + MODULE_WRAPPER_SUFFIX);\n\n const nameForMap: string = `(modules)/${id}`;\n\n const { source: wrappedCodeRaw, map } = useSourceMaps\n ? wrapped.sourceAndMap()\n : {\n source: wrapped.source(),\n map: undefined\n };\n\n const wrappedCode: string = wrappedCodeRaw.toString();\n const hash: string = hashCodeFragment(wrappedCode);\n metadata.hashByChunk.set(chunkRenderContext.chunk, hash);\n if (!submittedModules.has(hash)) {\n submittedModules.add(hash);\n\n ++pendingMinificationRequests;\n\n minifier.minify(\n {\n hash,\n code: wrappedCode,\n nameForMap: useSourceMaps ? nameForMap : undefined,\n externals: undefined\n },\n (result: IModuleMinificationResult) => {\n if (isMinificationResultError(result)) {\n compilation.errors.push(result.error as WebpackError);\n } else {\n try {\n const { code: minified, map: minifierMap } = result;\n\n const rawOutput: sources.Source = useSourceMaps\n ? new SourceMapSource(\n minified, // Code\n nameForMap, // File\n minifierMap!, // Base source map\n wrappedCode, // Source from before transform\n map!, // Source Map from before transform\n true // Remove original source\n )\n : new RawSource(minified);\n\n const unwrapped: sources.ReplaceSource = new ReplaceSource(rawOutput);\n const len: number = minified.length;\n\n // Trim off the boilerplate used to preserve the factory\n // Use different prefix/suffix lengths for shorthand vs regular format\n // Capture isShorthand from closure instead of looking it up\n if (isShorthand) {\n // For shorthand format: __MINIFY_MODULE__({__DEFAULT_ID__(args){...}});\n // Remove prefix and suffix by their lengths\n unwrapped.replace(0, MODULE_WRAPPER_SHORTHAND_PREFIX.length - 1, '');\n unwrapped.replace(len - MODULE_WRAPPER_SHORTHAND_SUFFIX.length, len - 1, '');\n } else {\n // Regular format: __MINIFY_MODULE__(function(args){...}); or __MINIFY_MODULE__((args)=>{...});\n unwrapped.replace(0, MODULE_WRAPPER_PREFIX.length - 1, '');\n unwrapped.replace(len - MODULE_WRAPPER_SUFFIX.length, len - 1, '');\n }\n\n const withIds: sources.Source = postProcessCode(unwrapped, {\n compilation,\n module: mod,\n loggingName: mod.identifier()\n });\n const cached: sources.CachedSource = new CachedSource(withIds);\n\n const minifiedSize: number = Buffer.byteLength(cached.source(), 'utf-8');\n metadata.sizeByHash.set(hash, minifiedSize);\n\n minifiedModules.set(hash, {\n source: cached,\n module: mod,\n id,\n isShorthand\n });\n } catch (err) {\n compilation.errors.push(err);\n }\n }\n\n onFileMinified();\n }\n );\n }\n\n // Create token with optional ':' prefix for shorthand modules\n // For non-shorthand: __WEBPACK_CHUNK_MODULE__hash (becomes \"id\":__WEBPACK_CHUNK_MODULE__hash in object)\n // For shorthand: :__WEBPACK_CHUNK_MODULE__hash (becomes \"id\"__WEBPACK_CHUNK_MODULE__hash, ':' makes it valid property assignment)\n const tokenPrefix: string = isShorthand ? ':' : '';\n const result: sources.Source = new RawSource(`${tokenPrefix}${CHUNK_MODULE_TOKEN}${hash}`);\n sourceCache.set(source, {\n hash,\n source: result,\n isShorthand\n });\n\n // Return an expression to replace later\n return result;\n }\n );\n\n // The optimizeChunkModules hook is the last async hook that occurs before chunk rendering\n compilation.hooks.optimizeChunkModules.tapPromise(PLUGIN_NAME, async () => {\n minifierConnection = await minifier.connectAsync();\n\n submittedModules.clear();\n });\n\n const isJSAsset: RegExp = /\\.[cm]?js(\\?.+)?$/;\n\n // This should happen before any other tasks that operate during processAssets\n compilation.hooks.processAssets.tapPromise(TAP_BEFORE, async (): Promise<void> => {\n const { chunkGraph, chunks } = compilation;\n\n // Still need to minify the rendered assets\n for (const chunk of chunks) {\n const allChunkModules: Iterable<Module> | undefined =\n chunkGraph.getChunkModulesIterableBySourceType(chunk, 'javascript');\n if (!allChunkModules) {\n // This chunk does not contain javascript modules\n continue;\n }\n\n for (const assetName of chunk.files) {\n const asset: sources.Source = compilation.assets[assetName];\n\n // Verify that this is a JS asset\n if (isJSAsset.test(assetName)) {\n ++pendingMinificationRequests;\n\n const { source: wrappedCodeRaw, map } = useSourceMaps\n ? asset.sourceAndMap()\n : {\n source: asset.source(),\n map: undefined\n };\n\n const rawCode: string = wrappedCodeRaw.toString();\n const nameForMap: string = `(chunks)/${assetName}`;\n\n const hash: string = hashCodeFragment(rawCode);\n\n minifier.minify(\n {\n hash,\n code: rawCode,\n nameForMap: useSourceMaps ? nameForMap : undefined,\n externals: undefined\n },\n (result: IModuleMinificationResult) => {\n if (isMinificationResultError(result)) {\n compilation.errors.push(result.error as WebpackError);\n // eslint-disable-next-line no-console\n console.error(result.error);\n } else {\n try {\n const { code: minified, map: minifierMap } = result;\n\n const rawOutput: sources.Source = useSourceMaps\n ? new SourceMapSource(\n minified, // Code\n nameForMap, // File\n minifierMap ?? undefined, // Base source map\n rawCode, // Source from before transform\n map ?? undefined, // Source Map from before transform\n true // Remove original source\n )\n : new RawSource(minified);\n\n const withIds: sources.Source = postProcessCode(new ReplaceSource(rawOutput), {\n compilation,\n module: undefined,\n loggingName: assetName\n });\n\n minifiedAssets.set(assetName, {\n source: new CachedSource(withIds),\n chunk,\n fileName: assetName,\n renderInfo: new Map(),\n type: 'javascript'\n });\n } catch (err) {\n compilation.errors.push(err);\n }\n }\n\n onFileMinified();\n }\n );\n } else {\n // This isn't a JS asset. Don't try to minify the asset wrapper, though if it contains modules, those might still get replaced with minified versions.\n minifiedAssets.set(assetName, {\n // Still need to restore ids\n source: postProcessCode(new ReplaceSource(asset), {\n compilation,\n module: undefined,\n loggingName: assetName\n }),\n chunk,\n fileName: assetName,\n renderInfo: new Map(),\n type: 'unknown'\n });\n }\n }\n }\n\n allRequestsIssued = true;\n\n if (pendingMinificationRequests) {\n await new Promise<void>((resolve) => {\n resolveMinifyPromise = resolve;\n });\n }\n\n // Handle any error from the minifier.\n await minifierConnection?.disconnectAsync();\n\n // All assets and modules have been minified, hand them off to be rehydrated\n await this.hooks.rehydrateAssets.promise(\n {\n assets: minifiedAssets,\n modules: minifiedModules\n },\n compilation\n );\n });\n\n // Need to update chunk hashes with information from this plugin\n javascriptHooks.chunkHash.tap(PLUGIN_NAME, (chunk, hash): void => {\n // Apply the options hash\n hash.update(binaryConfig);\n // Apply the hash from the minifier\n if (minifierConnection) {\n hash.update(minifierConnection.configHash, 'utf8');\n }\n });\n });\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ export {};
4
+ //# sourceMappingURL=ModuleMinifierPlugin.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleMinifierPlugin.types.js","sourceRoot":"","sources":["../src/ModuleMinifierPlugin.types.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { AsyncSeriesWaterfallHook, SyncWaterfallHook } from 'tapable';\nimport type { Chunk, Compilation, Module, sources } from 'webpack';\nimport type { Comment } from 'estree';\n\nimport type { IModuleMinifier } from '@rushstack/module-minifier';\n\n/**\n * Information about where the module was rendered in the emitted asset.\n * @public\n */\nexport interface IRenderedModulePosition {\n /**\n * The offset from the start of tha asset to the start of the module, in characters.\n */\n charOffset: number;\n /**\n * The length of the rendered module, in characters.\n */\n charLength: number;\n}\n\n/**\n * Information about a dehydrated webpack ECMAScript asset\n * @public\n */\nexport interface IAssetInfo {\n /**\n * The (minified) boilerplate code for the asset. Will contain a token to be replaced by the minified modules.\n */\n source: sources.Source;\n\n /**\n * The name of the asset, used to index into compilation.assets\n */\n fileName: string;\n\n /**\n * The raw chunk object from Webpack, in case information from it is necessary for reconstruction\n */\n chunk: Chunk;\n\n /**\n * Information about the offsets and character lengths for each rendered module in the final asset.\n */\n renderInfo: Map<string | number, IRenderedModulePosition>;\n\n /**\n * The type of the asset\n * @example 'javascript'\n * @example 'css'\n */\n type: string;\n}\n\n/**\n * Information about a minified module\n * @public\n */\nexport interface IModuleInfo {\n /**\n * The (minified) code of this module. Will be a function expression.\n */\n source: sources.Source;\n\n /**\n * The raw module object from Webpack, in case information from it is necessary for reconstruction\n */\n module: Module;\n\n /**\n * The id of the module, from the chunk graph.\n */\n id: string | number;\n\n /**\n * Whether this module was in method shorthand format\n */\n isShorthand?: boolean;\n}\n\n/**\n * This is the second parameter to the NormalModuleFactory `module` hook\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface _INormalModuleFactoryModuleData {\n resourceResolveData?: {\n /**\n * Contents of the description file (package.json) for the module\n */\n descriptionFileData?: {\n /**\n * The name of the package\n */\n name: string;\n };\n /**\n * Absolute path of the description file (package.json) for the module\n */\n descriptionFilePath?: string;\n /**\n * Absolute path of the directory containing the description file (package.json) for the module\n */\n descriptionFileRoot?: string;\n /**\n * Relative path from the description file (package.json) to the module\n */\n relativePath?: string;\n };\n}\n\n/**\n * Properties surfaced via the `factoryMeta` property on webpack modules\n * @public\n */\nexport interface IFactoryMeta {\n comments?: Comment[];\n skipMinification?: boolean;\n}\n\n/**\n * Statistics from the plugin. Namely module sizes.\n * @public\n */\nexport interface IModuleMinifierPluginStats {\n metadataByModule: WeakMap<Module, IModuleStats>;\n metadataByAssetFileName: Map<string, IAssetStats>;\n}\n\n/**\n * Module size data as a function of the target chunk.\n * @public\n */\nexport interface IModuleStats {\n hashByChunk: Map<Chunk, string>;\n sizeByHash: Map<string, number>;\n}\n\n/**\n * Rendered positional data\n * @public\n */\nexport interface IAssetStats {\n positionByModuleId: Map<string | number, IRenderedModulePosition>;\n}\n\n/**\n * A map from file names to dehydrated assets\n * @public\n */\nexport type IAssetMap = Map<string, IAssetInfo>;\n/**\n * A map from module ids to minified modules\n * @public\n */\nexport type IModuleMap = Map<string | number, IModuleInfo>;\n\n/**\n * Options to the ModuleMinifierPlugin constructor\n * @public\n */\nexport interface IModuleMinifierPluginOptions {\n /**\n * Minifier implementation to use. Required.\n */\n minifier: IModuleMinifier;\n\n /**\n * Whether to enable source map processing. If not provided, will attempt to guess based on `mode` and `devtool` in the webpack config.\n * Set to `false` for faster builds at the expense of debuggability.\n */\n sourceMap?: boolean;\n}\n\n/**\n * The set of data remaining to rehydrate in the current compilation\n * @public\n */\nexport interface IDehydratedAssets {\n /**\n * The set of remaining assets to rehydrate. Each tap may remove some or all assets from this collection\n */\n assets: IAssetMap;\n\n /**\n * The set of modules to use for rehydrating assets.\n */\n modules: IModuleMap;\n}\n\n/**\n * Argument to the postProcessCodeFragment hook for the current execution context\n * @public\n */\nexport interface IPostProcessFragmentContext {\n /**\n * The current webpack compilation, for error reporting\n */\n compilation: Compilation;\n /**\n * A name to use for logging\n */\n loggingName: string;\n /**\n * The current module being processed, or `undefined` if not in a module (e.g. the bootstrapper)\n */\n module: Module | undefined;\n}\n\n/**\n * Hooks provided by the ModuleMinifierPlugin\n * @public\n */\nexport interface IModuleMinifierPluginHooks {\n /**\n * Hook invoked at the start of optimizeChunkAssets to rehydrate the minified boilerplate and runtime into chunk assets.\n */\n rehydrateAssets: AsyncSeriesWaterfallHook<[IDehydratedAssets, Compilation]>;\n\n /**\n * Hook invoked on code after it has been returned from the minifier.\n */\n postProcessCodeFragment: SyncWaterfallHook<[sources.ReplaceSource, IPostProcessFragmentContext]>;\n}\n"]}
@@ -0,0 +1,80 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { CHUNK_MODULE_TOKEN, CHUNK_MODULE_REGEX } from './Constants';
4
+ /**
5
+ * Rehydrates an asset with minified modules.
6
+ * @param asset - The asset
7
+ * @param moduleMap - The minified modules
8
+ * @param banner - A banner to inject for license information
9
+ * @public
10
+ */
11
+ export function rehydrateAsset(compilation, asset, moduleMap, banner, emitRenderInfo) {
12
+ const { source: assetSource } = asset;
13
+ const { webpack: { sources, WebpackError } } = compilation.compiler;
14
+ const assetCode = assetSource.source().toString();
15
+ const tokenIndex = assetCode.indexOf(CHUNK_MODULE_TOKEN);
16
+ if (tokenIndex < 0) {
17
+ // This is not a JS asset.
18
+ return assetSource;
19
+ }
20
+ const { CachedSource, ConcatSource, ReplaceSource } = sources;
21
+ CHUNK_MODULE_REGEX.lastIndex = -1;
22
+ let lastStart = 0;
23
+ const cachedAssetSource = new CachedSource(assetSource);
24
+ const source = new ConcatSource(banner);
25
+ let charOffset = banner.length;
26
+ // RegExp.exec uses null or an array as the return type, explicitly
27
+ let match = null;
28
+ while ((match = CHUNK_MODULE_REGEX.exec(assetCode))) {
29
+ const leadingColon = match[1]; // Captured ':' or empty string
30
+ const hash = match[2]; // The module hash
31
+ const moduleSource = moduleMap.get(hash);
32
+ if (moduleSource === undefined) {
33
+ compilation.errors.push(new WebpackError(`Missing module source for ${hash} in ${asset.fileName}!`));
34
+ }
35
+ const separator = extractSegmentFromSource(ReplaceSource, cachedAssetSource, lastStart, match.index);
36
+ source.add(separator);
37
+ charOffset += separator.size();
38
+ lastStart = CHUNK_MODULE_REGEX.lastIndex;
39
+ if (moduleSource) {
40
+ // Check if this module was in shorthand format
41
+ const isShorthand = moduleSource.isShorthand === true;
42
+ // For shorthand format, omit the colon. For regular format, keep it.
43
+ if (!isShorthand && leadingColon) {
44
+ source.add(leadingColon);
45
+ charOffset += leadingColon.length;
46
+ }
47
+ const charLength = moduleSource.source.source().length;
48
+ if (emitRenderInfo) {
49
+ asset.renderInfo.set(moduleSource.id, {
50
+ charOffset,
51
+ charLength
52
+ });
53
+ }
54
+ source.add(moduleSource.source);
55
+ charOffset += charLength;
56
+ }
57
+ else {
58
+ // Keep the colon if present for error module
59
+ if (leadingColon) {
60
+ source.add(leadingColon);
61
+ charOffset += leadingColon.length;
62
+ }
63
+ const errorModule = `()=>{throw new Error(\`Missing module with hash "${hash}"\`)}`;
64
+ source.add(errorModule);
65
+ charOffset += errorModule.length;
66
+ }
67
+ source.add('\n');
68
+ charOffset += 1;
69
+ }
70
+ source.add(extractSegmentFromSource(ReplaceSource, cachedAssetSource, lastStart, Infinity));
71
+ return new CachedSource(source);
72
+ }
73
+ // In order to preserve source maps during substitution, have to use a ConcatSource instead of a ReplaceSource, so need to extract the segements from the original
74
+ function extractSegmentFromSource(replaceSourceConstructor, source, start, end) {
75
+ const result = new replaceSourceConstructor(source);
76
+ result.replace(end, Infinity, '');
77
+ result.replace(0, start - 1, '');
78
+ return result;
79
+ }
80
+ //# sourceMappingURL=RehydrateAsset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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AC,YAAY,CAAC,CAAC;gBACzB,UAAU,IAAI,YAAY,CAAC,MAAM,CAAC;YACpC,CAAC;YAED,MAAM,WAAW,GAAW,oDAAoD,IAAI,OAAO,CAAC;YAE5F,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACxB,UAAU,IAAI,WAAW,CAAC,MAAM,CAAC;QACnC,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjB,UAAU,IAAI,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,aAAa,EAAE,iBAAiB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5F,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,kKAAkK;AAClK,SAAS,wBAAwB,CAC/B,wBAAsD,EACtD,MAAsB,EACtB,KAAa,EACb,GAAW;IAEX,MAAM,MAAM,GAA0B,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAClC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { sources, Compilation } from 'webpack';\n\nimport { CHUNK_MODULE_TOKEN, CHUNK_MODULE_REGEX } from './Constants';\nimport type { IAssetInfo, IModuleMap, IModuleInfo } from './ModuleMinifierPlugin.types';\n\n/**\n * Rehydrates an asset with minified modules.\n * @param asset - The asset\n * @param moduleMap - The minified modules\n * @param banner - A banner to inject for license information\n * @public\n */\nexport function rehydrateAsset(\n compilation: Compilation,\n asset: IAssetInfo,\n moduleMap: IModuleMap,\n banner: string,\n emitRenderInfo?: boolean\n): sources.Source {\n const { source: assetSource } = asset;\n const {\n webpack: { sources, WebpackError }\n } = compilation.compiler;\n\n const assetCode: string = assetSource.source().toString();\n\n const tokenIndex: number = assetCode.indexOf(CHUNK_MODULE_TOKEN);\n if (tokenIndex < 0) {\n // This is not a JS asset.\n return assetSource;\n }\n\n const { CachedSource, ConcatSource, ReplaceSource } = sources;\n\n CHUNK_MODULE_REGEX.lastIndex = -1;\n let lastStart: number = 0;\n\n const cachedAssetSource: sources.CachedSource = new CachedSource(assetSource);\n\n const source: sources.ConcatSource = new ConcatSource(banner);\n let charOffset: number = banner.length;\n\n // RegExp.exec uses null or an array as the return type, explicitly\n let match: RegExpExecArray | null = null;\n while ((match = CHUNK_MODULE_REGEX.exec(assetCode))) {\n const leadingColon: string = match[1]; // Captured ':' or empty string\n const hash: string = match[2]; // The module hash\n\n const moduleSource: IModuleInfo | undefined = moduleMap.get(hash);\n if (moduleSource === undefined) {\n compilation.errors.push(new WebpackError(`Missing module source for ${hash} in ${asset.fileName}!`));\n }\n\n const separator: sources.ReplaceSource = extractSegmentFromSource(\n ReplaceSource,\n cachedAssetSource,\n lastStart,\n match.index\n );\n\n source.add(separator);\n charOffset += separator.size();\n\n lastStart = CHUNK_MODULE_REGEX.lastIndex;\n\n if (moduleSource) {\n // Check if this module was in shorthand format\n const isShorthand: boolean = moduleSource.isShorthand === true;\n\n // For shorthand format, omit the colon. For regular format, keep it.\n if (!isShorthand && leadingColon) {\n source.add(leadingColon);\n charOffset += leadingColon.length;\n }\n\n const charLength: number = moduleSource.source.source().length;\n\n if (emitRenderInfo) {\n asset.renderInfo.set(moduleSource.id, {\n charOffset,\n charLength\n });\n }\n\n source.add(moduleSource.source);\n charOffset += charLength;\n } else {\n // Keep the colon if present for error module\n if (leadingColon) {\n source.add(leadingColon);\n charOffset += leadingColon.length;\n }\n\n const errorModule: string = `()=>{throw new Error(\\`Missing module with hash \"${hash}\"\\`)}`;\n\n source.add(errorModule);\n charOffset += errorModule.length;\n }\n\n source.add('\\n');\n charOffset += 1;\n }\n\n source.add(extractSegmentFromSource(ReplaceSource, cachedAssetSource, lastStart, Infinity));\n\n return new CachedSource(source);\n}\n\n// In order to preserve source maps during substitution, have to use a ConcatSource instead of a ReplaceSource, so need to extract the segements from the original\nfunction extractSegmentFromSource(\n replaceSourceConstructor: typeof sources.ReplaceSource,\n source: sources.Source,\n start: number,\n end: number\n): sources.ReplaceSource {\n const result: sources.ReplaceSource = new replaceSourceConstructor(source);\n result.replace(end, Infinity, '');\n result.replace(0, start - 1, '');\n return result;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ export { MODULE_WRAPPER_PREFIX, MODULE_WRAPPER_SUFFIX, MODULE_WRAPPER_SHORTHAND_PREFIX, MODULE_WRAPPER_SHORTHAND_SUFFIX, CHUNK_MODULE_TOKEN, CHUNK_MODULE_REGEX, STAGE_BEFORE, STAGE_AFTER } from './Constants';
4
+ export { generateLicenseFileForAsset } from './GenerateLicenseFileForAsset';
5
+ export { ModuleMinifierPlugin } from './ModuleMinifierPlugin';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,+BAA+B,EAC/B,+BAA+B,EAC/B,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAgB5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nexport {\n MODULE_WRAPPER_PREFIX,\n MODULE_WRAPPER_SUFFIX,\n MODULE_WRAPPER_SHORTHAND_PREFIX,\n MODULE_WRAPPER_SHORTHAND_SUFFIX,\n CHUNK_MODULE_TOKEN,\n CHUNK_MODULE_REGEX,\n STAGE_BEFORE,\n STAGE_AFTER\n} from './Constants';\nexport { generateLicenseFileForAsset } from './GenerateLicenseFileForAsset';\nexport type {\n IAssetInfo,\n IAssetMap,\n IAssetStats,\n IDehydratedAssets,\n IFactoryMeta,\n IModuleInfo,\n IModuleMap,\n IModuleMinifierPluginHooks,\n IModuleMinifierPluginOptions,\n IModuleMinifierPluginStats,\n IModuleStats,\n IPostProcessFragmentContext,\n IRenderedModulePosition\n} from './ModuleMinifierPlugin.types';\nexport { ModuleMinifierPlugin } from './ModuleMinifierPlugin';\n"]}
package/package.json CHANGED
@@ -1,9 +1,32 @@
1
1
  {
2
2
  "name": "@rushstack/webpack5-module-minifier-plugin",
3
- "version": "5.7.0",
3
+ "version": "5.8.1",
4
4
  "description": "This plugin splits minification of webpack compilations into smaller units.",
5
- "main": "lib/index.js",
6
- "typings": "dist/webpack5-module-minifier-plugin.d.ts",
5
+ "main": "./lib-commonjs/index.js",
6
+ "module": "./lib-esm/index.js",
7
+ "types": "./dist/webpack5-module-minifier-plugin.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/webpack5-module-minifier-plugin.d.ts",
11
+ "node": "./lib-commonjs/index.js",
12
+ "import": "./lib-esm/index.js",
13
+ "require": "./lib-commonjs/index.js"
14
+ },
15
+ "./lib/*": {
16
+ "types": "./lib-dts/*.d.ts",
17
+ "node": "./lib-commonjs/*.js",
18
+ "import": "./lib-esm/*.js",
19
+ "require": "./lib-commonjs/*.js"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "typesVersions": {
24
+ "*": {
25
+ "lib/*": [
26
+ "lib-dts/*"
27
+ ]
28
+ }
29
+ },
7
30
  "license": "MIT",
8
31
  "repository": {
9
32
  "type": "git",
@@ -22,16 +45,16 @@
22
45
  "@types/tapable": "1.0.6",
23
46
  "@types/estree": "1.0.8",
24
47
  "tapable": "2.2.1",
25
- "@rushstack/worker-pool": "0.6.14"
48
+ "@rushstack/worker-pool": "0.7.1"
26
49
  },
27
50
  "devDependencies": {
28
51
  "@types/node": "20.17.19",
29
52
  "eslint": "~9.37.0",
30
53
  "memfs": "4.12.0",
31
54
  "webpack": "~5.105.2",
32
- "@rushstack/heft": "1.1.14",
33
- "local-node-rig": "1.0.0",
34
- "@rushstack/module-minifier": "0.8.14"
55
+ "@rushstack/heft": "1.2.1",
56
+ "@rushstack/module-minifier": "0.9.1",
57
+ "local-node-rig": "1.0.0"
35
58
  },
36
59
  "sideEffects": false,
37
60
  "peerDependenciesMeta": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes