webpack 5.105.2 → 5.105.4
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/lib/CleanPlugin.js +1 -0
- package/lib/Compilation.js +10 -8
- package/lib/ContextModule.js +14 -8
- package/lib/Dependency.js +1 -1
- package/lib/EnvironmentNotSupportAsyncWarning.js +1 -0
- package/lib/EvalDevToolModulePlugin.js +3 -0
- package/lib/EvalSourceMapDevToolPlugin.js +8 -1
- package/lib/ExportsInfo.js +0 -30
- package/lib/ExternalModule.js +2 -2
- package/lib/Module.js +45 -5
- package/lib/ModuleGraphConnection.js +0 -9
- package/lib/MultiStats.js +5 -5
- package/lib/RuntimeModule.js +18 -1
- package/lib/SourceMapDevToolModuleOptionsPlugin.js +1 -0
- package/lib/SourceMapDevToolPlugin.js +10 -2
- package/lib/Stats.js +3 -2
- package/lib/WebpackOptionsApply.js +13 -3
- package/lib/asset/AssetModulesPlugin.js +16 -1
- package/lib/asset/RawDataUrlModule.js +5 -1
- package/lib/container/RemoteModule.js +18 -1
- package/lib/css/CssGenerator.js +13 -6
- package/lib/css/CssModulesPlugin.js +7 -0
- package/lib/dependencies/CommonJsExportRequireDependency.js +4 -0
- package/lib/dependencies/CommonJsImportsParserPlugin.js +314 -508
- package/lib/dependencies/CreateRequireParserPlugin.js +356 -0
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +4 -8
- package/lib/dependencies/HarmonyImportDependency.js +30 -0
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +128 -224
- package/lib/dependencies/HarmonyImportSideEffectDependency.js +11 -5
- package/lib/dependencies/HarmonyModulesPlugin.js +4 -0
- package/lib/dependencies/ImportParserPlugin.js +1 -11
- package/lib/dependencies/ImportPhase.js +4 -0
- package/lib/javascript/JavascriptModulesPlugin.js +75 -22
- package/lib/javascript/JavascriptParser.js +2 -2
- package/lib/optimize/ConcatenatedModule.js +3 -0
- package/lib/optimize/ModuleConcatenationPlugin.js +4 -1
- package/lib/performance/AssetsOverSizeLimitWarning.js +1 -0
- package/lib/performance/EntrypointsOverSizeLimitWarning.js +1 -0
- package/lib/performance/SizeLimitsPlugin.js +1 -0
- package/lib/runtime/ToBinaryRuntimeModule.js +14 -6
- package/lib/sharing/ConsumeSharedModule.js +18 -1
- package/lib/util/AppendOnlyStackedSet.js +22 -1
- package/lib/util/findGraphRoots.js +79 -109
- package/package.json +14 -11
- package/types.d.ts +243 -99
|
@@ -386,6 +386,13 @@ class CssModulesPlugin {
|
|
|
386
386
|
compilation
|
|
387
387
|
).renderModuleContent.tap(PLUGIN_NAME, (source, module) => {
|
|
388
388
|
if (module instanceof CssModule && module.hot) {
|
|
389
|
+
const exportType = /** @type {BuildMeta} */ (module.buildMeta)
|
|
390
|
+
.exportType;
|
|
391
|
+
// When exportType !== "link", modules behave like JavaScript modules
|
|
392
|
+
if (exportType && exportType !== "link") {
|
|
393
|
+
return source;
|
|
394
|
+
}
|
|
395
|
+
// For exportType === "link", we can optimize with self-acceptance
|
|
389
396
|
const cssData = /** @type {BuildInfo} */ (module.buildInfo).cssData;
|
|
390
397
|
if (!cssData) {
|
|
391
398
|
return source;
|
|
@@ -65,6 +65,10 @@ class CommonJsExportRequireDependency extends ModuleDependency {
|
|
|
65
65
|
return "cjs export require";
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
get category() {
|
|
69
|
+
return "commonjs";
|
|
70
|
+
}
|
|
71
|
+
|
|
68
72
|
/**
|
|
69
73
|
* @returns {boolean | TRANSITIVE} true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module
|
|
70
74
|
*/
|