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.
Files changed (45) hide show
  1. package/lib/CleanPlugin.js +1 -0
  2. package/lib/Compilation.js +10 -8
  3. package/lib/ContextModule.js +14 -8
  4. package/lib/Dependency.js +1 -1
  5. package/lib/EnvironmentNotSupportAsyncWarning.js +1 -0
  6. package/lib/EvalDevToolModulePlugin.js +3 -0
  7. package/lib/EvalSourceMapDevToolPlugin.js +8 -1
  8. package/lib/ExportsInfo.js +0 -30
  9. package/lib/ExternalModule.js +2 -2
  10. package/lib/Module.js +45 -5
  11. package/lib/ModuleGraphConnection.js +0 -9
  12. package/lib/MultiStats.js +5 -5
  13. package/lib/RuntimeModule.js +18 -1
  14. package/lib/SourceMapDevToolModuleOptionsPlugin.js +1 -0
  15. package/lib/SourceMapDevToolPlugin.js +10 -2
  16. package/lib/Stats.js +3 -2
  17. package/lib/WebpackOptionsApply.js +13 -3
  18. package/lib/asset/AssetModulesPlugin.js +16 -1
  19. package/lib/asset/RawDataUrlModule.js +5 -1
  20. package/lib/container/RemoteModule.js +18 -1
  21. package/lib/css/CssGenerator.js +13 -6
  22. package/lib/css/CssModulesPlugin.js +7 -0
  23. package/lib/dependencies/CommonJsExportRequireDependency.js +4 -0
  24. package/lib/dependencies/CommonJsImportsParserPlugin.js +314 -508
  25. package/lib/dependencies/CreateRequireParserPlugin.js +356 -0
  26. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +4 -8
  27. package/lib/dependencies/HarmonyImportDependency.js +30 -0
  28. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +128 -224
  29. package/lib/dependencies/HarmonyImportSideEffectDependency.js +11 -5
  30. package/lib/dependencies/HarmonyModulesPlugin.js +4 -0
  31. package/lib/dependencies/ImportParserPlugin.js +1 -11
  32. package/lib/dependencies/ImportPhase.js +4 -0
  33. package/lib/javascript/JavascriptModulesPlugin.js +75 -22
  34. package/lib/javascript/JavascriptParser.js +2 -2
  35. package/lib/optimize/ConcatenatedModule.js +3 -0
  36. package/lib/optimize/ModuleConcatenationPlugin.js +4 -1
  37. package/lib/performance/AssetsOverSizeLimitWarning.js +1 -0
  38. package/lib/performance/EntrypointsOverSizeLimitWarning.js +1 -0
  39. package/lib/performance/SizeLimitsPlugin.js +1 -0
  40. package/lib/runtime/ToBinaryRuntimeModule.js +14 -6
  41. package/lib/sharing/ConsumeSharedModule.js +18 -1
  42. package/lib/util/AppendOnlyStackedSet.js +22 -1
  43. package/lib/util/findGraphRoots.js +79 -109
  44. package/package.json +14 -11
  45. 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
  */