@rushstack/webpack5-module-minifier-plugin 5.6.7 → 5.6.10

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.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "@rushstack/webpack5-module-minifier-plugin",
3
3
  "entries": [
4
+ {
5
+ "version": "5.6.10",
6
+ "tag": "@rushstack/webpack5-module-minifier-plugin_v5.6.10",
7
+ "date": "Thu, 08 Jan 2026 01:12:30 GMT",
8
+ "comments": {
9
+ "dependency": [
10
+ {
11
+ "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.6.10`"
12
+ },
13
+ {
14
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.1.10`"
15
+ },
16
+ {
17
+ "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.8.10`"
18
+ },
19
+ {
20
+ "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `0.8.10`"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "version": "5.6.9",
27
+ "tag": "@rushstack/webpack5-module-minifier-plugin_v5.6.9",
28
+ "date": "Wed, 07 Jan 2026 01:12:25 GMT",
29
+ "comments": {
30
+ "dependency": [
31
+ {
32
+ "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.6.9`"
33
+ },
34
+ {
35
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.1.9`"
36
+ },
37
+ {
38
+ "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.8.9`"
39
+ },
40
+ {
41
+ "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `0.8.9`"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "version": "5.6.8",
48
+ "tag": "@rushstack/webpack5-module-minifier-plugin_v5.6.8",
49
+ "date": "Mon, 05 Jan 2026 16:12:49 GMT",
50
+ "comments": {
51
+ "dependency": [
52
+ {
53
+ "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.6.8`"
54
+ },
55
+ {
56
+ "comment": "Updating dependency \"@rushstack/heft\" to `1.1.8`"
57
+ },
58
+ {
59
+ "comment": "Updating dependency \"@rushstack/module-minifier\" to `0.8.8`"
60
+ },
61
+ {
62
+ "comment": "Updating dependency \"@rushstack/module-minifier\" from `*` to `0.8.8`"
63
+ }
64
+ ]
65
+ }
66
+ },
4
67
  {
5
68
  "version": "5.6.7",
6
69
  "tag": "@rushstack/webpack5-module-minifier-plugin_v5.6.7",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # Change Log - @rushstack/webpack5-module-minifier-plugin
2
2
 
3
- This log was last generated on Sat, 06 Dec 2025 01:12:28 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 08 Jan 2026 01:12:30 GMT and should not be manually modified.
4
+
5
+ ## 5.6.10
6
+ Thu, 08 Jan 2026 01:12:30 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 5.6.9
11
+ Wed, 07 Jan 2026 01:12:25 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 5.6.8
16
+ Mon, 05 Jan 2026 16:12:49 GMT
17
+
18
+ _Version update only_
4
19
 
5
20
  ## 5.6.7
6
21
  Sat, 06 Dec 2025 01:12:28 GMT
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.55.1"
8
+ "packageVersion": "7.55.5"
9
9
  }
10
10
  ]
11
11
  }
@@ -331,9 +331,9 @@ class ModuleMinifierPlugin {
331
331
  const rawOutput = useSourceMaps
332
332
  ? new SourceMapSource(minified, // Code
333
333
  nameForMap, // File
334
- minifierMap, // Base source map
334
+ minifierMap !== null && minifierMap !== void 0 ? minifierMap : undefined, // Base source map
335
335
  rawCode, // Source from before transform
336
- map, // Source Map from before transform
336
+ map !== null && map !== void 0 ? map : undefined, // Source Map from before transform
337
337
  true // Remove original source
338
338
  )
339
339
  : new RawSource(minified);
@@ -1 +1 @@
1
- {"version":3,"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CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CACtC;oBACE,MAAM,EAAE,cAAc;oBACtB,OAAO,EAAE,eAAe;iBACzB,EACD,WAAW,CACZ,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,gEAAgE;YAChE,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,IAAI,EAAQ,EAAE;gBAC/D,yBAAyB;gBACzB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAC1B,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;AAnbD,oDAmbC","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 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}\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 * 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 // If this module is wrapped in a factory, need to add boilerplate so that the minifier keeps the function\n const wrapped: sources.Source = new ConcatSource(\n MODULE_WRAPPER_PREFIX + '\\n',\n source,\n '\\n' + MODULE_WRAPPER_SUFFIX\n );\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 unwrapped.replace(0, MODULE_WRAPPER_PREFIX.length - 1, '');\n unwrapped.replace(len - MODULE_WRAPPER_SUFFIX.length, len - 1, '');\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 });\n } catch (err) {\n compilation.errors.push(err);\n }\n }\n\n onFileMinified();\n }\n );\n }\n\n const result: sources.Source = new RawSource(`${CHUNK_MODULE_TOKEN}${hash}`);\n sourceCache.set(source, {\n hash,\n source: result\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!, // Base source map\n rawCode, // Source from before transform\n map, // 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"]}
1
+ {"version":3,"file":"ModuleMinifierPlugin.js","sourceRoot":"","sources":["../src/ModuleMinifierPlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,6CAA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E,MAAM,EAAE,cAAc;oBACtB,OAAO,EAAE,eAAe;iBACzB,EACD,WAAW,CACZ,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,gEAAgE;YAChE,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,IAAI,EAAQ,EAAE;gBAC/D,yBAAyB;gBACzB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAC1B,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;AAnbD,oDAmbC","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 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}\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 * 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 // If this module is wrapped in a factory, need to add boilerplate so that the minifier keeps the function\n const wrapped: sources.Source = new ConcatSource(\n MODULE_WRAPPER_PREFIX + '\\n',\n source,\n '\\n' + MODULE_WRAPPER_SUFFIX\n );\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 unwrapped.replace(0, MODULE_WRAPPER_PREFIX.length - 1, '');\n unwrapped.replace(len - MODULE_WRAPPER_SUFFIX.length, len - 1, '');\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 });\n } catch (err) {\n compilation.errors.push(err);\n }\n }\n\n onFileMinified();\n }\n );\n }\n\n const result: sources.Source = new RawSource(`${CHUNK_MODULE_TOKEN}${hash}`);\n sourceCache.set(source, {\n hash,\n source: result\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"]}
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export * from './Constants';
2
- export * from './GenerateLicenseFileForAsset';
1
+ export { MODULE_WRAPPER_PREFIX, MODULE_WRAPPER_SUFFIX, CHUNK_MODULE_TOKEN, CHUNK_MODULE_REGEX, STAGE_BEFORE, STAGE_AFTER } from './Constants';
2
+ export { generateLicenseFileForAsset } from './GenerateLicenseFileForAsset';
3
3
  export type { IAssetInfo, IAssetMap, IAssetStats, IDehydratedAssets, IFactoryMeta, IModuleInfo, IModuleMap, IModuleMinifierPluginHooks, IModuleMinifierPluginOptions, IModuleMinifierPluginStats, IModuleStats, IPostProcessFragmentContext, IRenderedModulePosition } from './ModuleMinifierPlugin.types';
4
- export * from './ModuleMinifierPlugin';
4
+ export { ModuleMinifierPlugin } from './ModuleMinifierPlugin';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,aAAa,CAAC;AAC5B,cAAc,+BAA+B,CAAC;AAC9C,YAAY,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,YAAY,EACZ,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,YAAY,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,YAAY,EACZ,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
package/lib/index.js CHANGED
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
2
  // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
3
  // See LICENSE in the project root for license information.
4
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
- if (k2 === undefined) k2 = k;
6
- var desc = Object.getOwnPropertyDescriptor(m, k);
7
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
- desc = { enumerable: true, get: function() { return m[k]; } };
9
- }
10
- Object.defineProperty(o, k2, desc);
11
- }) : (function(o, m, k, k2) {
12
- if (k2 === undefined) k2 = k;
13
- o[k2] = m[k];
14
- }));
15
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
- };
18
4
  Object.defineProperty(exports, "__esModule", { value: true });
19
- __exportStar(require("./Constants"), exports);
20
- __exportStar(require("./GenerateLicenseFileForAsset"), exports);
21
- __exportStar(require("./ModuleMinifierPlugin"), exports);
5
+ exports.ModuleMinifierPlugin = exports.generateLicenseFileForAsset = exports.STAGE_AFTER = exports.STAGE_BEFORE = exports.CHUNK_MODULE_REGEX = exports.CHUNK_MODULE_TOKEN = exports.MODULE_WRAPPER_SUFFIX = exports.MODULE_WRAPPER_PREFIX = void 0;
6
+ var Constants_1 = require("./Constants");
7
+ Object.defineProperty(exports, "MODULE_WRAPPER_PREFIX", { enumerable: true, get: function () { return Constants_1.MODULE_WRAPPER_PREFIX; } });
8
+ Object.defineProperty(exports, "MODULE_WRAPPER_SUFFIX", { enumerable: true, get: function () { return Constants_1.MODULE_WRAPPER_SUFFIX; } });
9
+ Object.defineProperty(exports, "CHUNK_MODULE_TOKEN", { enumerable: true, get: function () { return Constants_1.CHUNK_MODULE_TOKEN; } });
10
+ Object.defineProperty(exports, "CHUNK_MODULE_REGEX", { enumerable: true, get: function () { return Constants_1.CHUNK_MODULE_REGEX; } });
11
+ Object.defineProperty(exports, "STAGE_BEFORE", { enumerable: true, get: function () { return Constants_1.STAGE_BEFORE; } });
12
+ Object.defineProperty(exports, "STAGE_AFTER", { enumerable: true, get: function () { return Constants_1.STAGE_AFTER; } });
13
+ var GenerateLicenseFileForAsset_1 = require("./GenerateLicenseFileForAsset");
14
+ Object.defineProperty(exports, "generateLicenseFileForAsset", { enumerable: true, get: function () { return GenerateLicenseFileForAsset_1.generateLicenseFileForAsset; } });
15
+ var ModuleMinifierPlugin_1 = require("./ModuleMinifierPlugin");
16
+ Object.defineProperty(exports, "ModuleMinifierPlugin", { enumerable: true, get: function () { return ModuleMinifierPlugin_1.ModuleMinifierPlugin; } });
22
17
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;AAE3D,8CAA4B;AAC5B,gEAA8C;AAgB9C,yDAAuC","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 * from './Constants';\nexport * 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 * from './ModuleMinifierPlugin';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,yCAOqB;AANnB,kHAAA,qBAAqB,OAAA;AACrB,kHAAA,qBAAqB,OAAA;AACrB,+GAAA,kBAAkB,OAAA;AAClB,+GAAA,kBAAkB,OAAA;AAClB,yGAAA,YAAY,OAAA;AACZ,wGAAA,WAAW,OAAA;AAEb,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AAgBpC,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA","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 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/webpack5-module-minifier-plugin",
3
- "version": "5.6.7",
3
+ "version": "5.6.10",
4
4
  "description": "This plugin splits minification of webpack compilations into smaller units.",
5
5
  "main": "lib/index.js",
6
6
  "typings": "dist/webpack5-module-minifier-plugin.d.ts",
@@ -20,18 +20,18 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@types/tapable": "1.0.6",
23
- "@types/estree": "1.0.6",
23
+ "@types/estree": "1.0.8",
24
24
  "tapable": "2.2.1",
25
- "@rushstack/worker-pool": "0.6.7"
25
+ "@rushstack/worker-pool": "0.6.10"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "20.17.19",
29
29
  "eslint": "~9.37.0",
30
30
  "memfs": "4.12.0",
31
- "webpack": "~5.98.0",
32
- "@rushstack/heft": "1.1.7",
33
- "@rushstack/module-minifier": "0.8.7",
34
- "local-node-rig": "1.0.0"
31
+ "webpack": "~5.103.0",
32
+ "@rushstack/module-minifier": "0.8.10",
33
+ "local-node-rig": "1.0.0",
34
+ "@rushstack/heft": "1.1.10"
35
35
  },
36
36
  "sideEffects": false,
37
37
  "peerDependenciesMeta": {