webpack 5.37.0 → 5.39.0

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.

Potentially problematic release.


This version of webpack might be problematic. Click here for more details.

Files changed (139) hide show
  1. package/README.md +5 -8
  2. package/bin/webpack.js +20 -5
  3. package/lib/AsyncDependencyToInitialChunkError.js +0 -2
  4. package/lib/CacheFacade.js +3 -3
  5. package/lib/CaseSensitiveModulesWarning.js +0 -2
  6. package/lib/Chunk.js +8 -5
  7. package/lib/ChunkRenderError.js +0 -2
  8. package/lib/CodeGenerationError.js +0 -2
  9. package/lib/CommentCompilationWarning.js +0 -2
  10. package/lib/Compilation.js +43 -55
  11. package/lib/Compiler.js +7 -4
  12. package/lib/ConcatenationScope.js +2 -1
  13. package/lib/ConcurrentCompilationError.js +0 -2
  14. package/lib/ContextModule.js +5 -4
  15. package/lib/ContextModuleFactory.js +3 -1
  16. package/lib/ContextReplacementPlugin.js +4 -3
  17. package/lib/DefinePlugin.js +16 -12
  18. package/lib/DllReferencePlugin.js +0 -2
  19. package/lib/EntryPlugin.js +3 -3
  20. package/lib/EvalSourceMapDevToolPlugin.js +3 -1
  21. package/lib/ExportsInfo.js +20 -13
  22. package/lib/FileSystemInfo.js +24 -30
  23. package/lib/FlagDependencyExportsPlugin.js +8 -7
  24. package/lib/FlagDependencyUsagePlugin.js +2 -4
  25. package/lib/HarmonyLinkingError.js +0 -2
  26. package/lib/HookWebpackError.js +0 -1
  27. package/lib/HotModuleReplacementPlugin.js +27 -32
  28. package/lib/InvalidDependenciesModuleWarning.js +0 -2
  29. package/lib/JavascriptMetaInfoPlugin.js +2 -1
  30. package/lib/MainTemplate.js +2 -3
  31. package/lib/ModuleBuildError.js +0 -2
  32. package/lib/ModuleDependencyError.js +0 -2
  33. package/lib/ModuleDependencyWarning.js +0 -2
  34. package/lib/ModuleError.js +0 -2
  35. package/lib/ModuleFilenameHelpers.js +4 -2
  36. package/lib/ModuleGraphConnection.js +6 -2
  37. package/lib/ModuleInfoHeaderPlugin.js +2 -3
  38. package/lib/ModuleNotFoundError.js +0 -2
  39. package/lib/ModuleParseError.js +0 -2
  40. package/lib/ModuleRestoreError.js +0 -2
  41. package/lib/ModuleStoreError.js +0 -2
  42. package/lib/ModuleWarning.js +0 -2
  43. package/lib/MultiCompiler.js +31 -27
  44. package/lib/NoModeWarning.js +0 -2
  45. package/lib/NormalModule.js +26 -8
  46. package/lib/NormalModuleFactory.js +2 -0
  47. package/lib/RecordIdsPlugin.js +5 -4
  48. package/lib/ResolverFactory.js +10 -7
  49. package/lib/SourceMapDevToolPlugin.js +13 -14
  50. package/lib/Template.js +4 -2
  51. package/lib/UnsupportedFeatureWarning.js +0 -2
  52. package/lib/WarnDeprecatedOptionPlugin.js +0 -2
  53. package/lib/Watching.js +91 -47
  54. package/lib/WebpackError.js +0 -2
  55. package/lib/asset/AssetGenerator.js +46 -29
  56. package/lib/asset/AssetModulesPlugin.js +1 -1
  57. package/lib/buildChunkGraph.js +21 -21
  58. package/lib/cache/PackFileCacheStrategy.js +12 -9
  59. package/lib/config/defaults.js +21 -10
  60. package/lib/config/normalization.js +8 -7
  61. package/lib/config/target.js +7 -2
  62. package/lib/debug/ProfilingPlugin.js +4 -3
  63. package/lib/dependencies/AMDRequireDependency.js +3 -3
  64. package/lib/dependencies/CommonJsExportRequireDependency.js +2 -3
  65. package/lib/dependencies/CommonJsExportsParserPlugin.js +3 -1
  66. package/lib/dependencies/CommonJsImportsParserPlugin.js +2 -4
  67. package/lib/dependencies/CommonJsPlugin.js +8 -7
  68. package/lib/dependencies/CommonJsRequireContextDependency.js +2 -1
  69. package/lib/dependencies/ContextDependencyHelpers.js +10 -8
  70. package/lib/dependencies/ContextElementDependency.js +6 -1
  71. package/lib/dependencies/CriticalDependencyWarning.js +0 -2
  72. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +11 -13
  73. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +2 -4
  74. package/lib/dependencies/HarmonyImportSpecifierDependency.js +4 -11
  75. package/lib/dependencies/ImportDependency.js +3 -3
  76. package/lib/dependencies/ImportParserPlugin.js +3 -4
  77. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +2 -3
  78. package/lib/dependencies/RequireEnsureDependency.js +3 -3
  79. package/lib/dependencies/RequireIncludeDependencyParserPlugin.js +0 -2
  80. package/lib/dependencies/SystemPlugin.js +0 -2
  81. package/lib/dependencies/WorkerDependency.js +6 -6
  82. package/lib/dependencies/WorkerPlugin.js +18 -19
  83. package/lib/errors/BuildCycleError.js +0 -1
  84. package/lib/hmr/LazyCompilationPlugin.js +9 -5
  85. package/lib/ids/HashedModuleIdsPlugin.js +3 -3
  86. package/lib/ids/OccurrenceModuleIdsPlugin.js +2 -3
  87. package/lib/index.js +5 -3
  88. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -6
  89. package/lib/javascript/CommonJsChunkFormatPlugin.js +2 -3
  90. package/lib/javascript/JavascriptGenerator.js +3 -1
  91. package/lib/javascript/JavascriptModulesPlugin.js +15 -23
  92. package/lib/javascript/JavascriptParser.js +10 -8
  93. package/lib/library/AssignLibraryPlugin.js +4 -2
  94. package/lib/node/NodeEnvironmentPlugin.js +1 -0
  95. package/lib/node/NodeWatchFileSystem.js +19 -4
  96. package/lib/optimize/AggressiveSplittingPlugin.js +5 -4
  97. package/lib/optimize/ConcatenatedModule.js +31 -27
  98. package/lib/optimize/FlagIncludedChunksPlugin.js +4 -6
  99. package/lib/optimize/InnerGraph.js +9 -11
  100. package/lib/optimize/InnerGraphPlugin.js +3 -1
  101. package/lib/optimize/ModuleConcatenationPlugin.js +7 -10
  102. package/lib/optimize/RealContentHashPlugin.js +14 -16
  103. package/lib/optimize/SideEffectsFlagPlugin.js +6 -5
  104. package/lib/optimize/SplitChunksPlugin.js +13 -15
  105. package/lib/performance/AssetsOverSizeLimitWarning.js +0 -2
  106. package/lib/performance/EntrypointsOverSizeLimitWarning.js +0 -2
  107. package/lib/performance/NoAsyncChunksWarning.js +0 -2
  108. package/lib/runtime/EnsureChunkRuntimeModule.js +9 -8
  109. package/lib/runtime/LoadScriptRuntimeModule.js +2 -3
  110. package/lib/runtime/OnChunksLoadedRuntimeModule.js +38 -37
  111. package/lib/schemes/DataUriPlugin.js +21 -2
  112. package/lib/serialization/BinaryMiddleware.js +5 -3
  113. package/lib/serialization/FileMiddleware.js +3 -1
  114. package/lib/serialization/ObjectMiddleware.js +11 -7
  115. package/lib/stats/DefaultStatsFactoryPlugin.js +7 -7
  116. package/lib/stats/DefaultStatsPrinterPlugin.js +11 -9
  117. package/lib/stats/StatsFactory.js +2 -1
  118. package/lib/stats/StatsPrinter.js +3 -3
  119. package/lib/util/LazyBucketSortedSet.js +3 -3
  120. package/lib/util/cleverMerge.js +3 -1
  121. package/lib/util/comparators.js +13 -13
  122. package/lib/util/createHash.js +5 -4
  123. package/lib/util/identifier.js +2 -1
  124. package/lib/util/serialization.js +108 -59
  125. package/lib/validateSchema.js +5 -3
  126. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +4 -4
  127. package/lib/wasm-sync/UnsupportedWebAssemblyFeatureError.js +0 -2
  128. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +5 -4
  129. package/lib/wasm-sync/WebAssemblyGenerator.js +89 -83
  130. package/lib/wasm-sync/WebAssemblyInInitialChunkError.js +0 -2
  131. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -1
  132. package/lib/wasm-sync/WebAssemblyParser.js +6 -5
  133. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -4
  134. package/lib/webpack.js +11 -7
  135. package/package.json +9 -6
  136. package/schemas/WebpackOptions.check.js +1 -1
  137. package/schemas/WebpackOptions.json +76 -60
  138. package/types.d.ts +112 -262
  139. package/lib/util/DataURI.js +0 -32
@@ -3391,40 +3391,13 @@
3391
3391
  {
3392
3392
  "type": "string"
3393
3393
  },
3394
- {
3395
- "type": "object",
3396
- "additionalProperties": false,
3397
- "properties": {
3398
- "and": {
3399
- "description": "Logical AND.",
3400
- "oneOf": [
3401
- {
3402
- "$ref": "#/definitions/RuleSetConditions"
3403
- }
3404
- ]
3405
- },
3406
- "not": {
3407
- "description": "Logical NOT.",
3408
- "oneOf": [
3409
- {
3410
- "$ref": "#/definitions/RuleSetConditions"
3411
- }
3412
- ]
3413
- },
3414
- "or": {
3415
- "description": "Logical OR.",
3416
- "oneOf": [
3417
- {
3418
- "$ref": "#/definitions/RuleSetConditions"
3419
- }
3420
- ]
3421
- }
3422
- }
3423
- },
3424
3394
  {
3425
3395
  "instanceof": "Function",
3426
3396
  "tsType": "((value: string) => boolean)"
3427
3397
  },
3398
+ {
3399
+ "$ref": "#/definitions/RuleSetLogicalConditions"
3400
+ },
3428
3401
  {
3429
3402
  "$ref": "#/definitions/RuleSetConditions"
3430
3403
  }
@@ -3444,40 +3417,13 @@
3444
3417
  "type": "string",
3445
3418
  "absolutePath": true
3446
3419
  },
3447
- {
3448
- "type": "object",
3449
- "additionalProperties": false,
3450
- "properties": {
3451
- "and": {
3452
- "description": "Logical AND.",
3453
- "oneOf": [
3454
- {
3455
- "$ref": "#/definitions/RuleSetConditionsAbsolute"
3456
- }
3457
- ]
3458
- },
3459
- "not": {
3460
- "description": "Logical NOT.",
3461
- "oneOf": [
3462
- {
3463
- "$ref": "#/definitions/RuleSetConditionsAbsolute"
3464
- }
3465
- ]
3466
- },
3467
- "or": {
3468
- "description": "Logical OR.",
3469
- "oneOf": [
3470
- {
3471
- "$ref": "#/definitions/RuleSetConditionsAbsolute"
3472
- }
3473
- ]
3474
- }
3475
- }
3476
- },
3477
3420
  {
3478
3421
  "instanceof": "Function",
3479
3422
  "tsType": "((value: string) => boolean)"
3480
3423
  },
3424
+ {
3425
+ "$ref": "#/definitions/RuleSetLogicalConditionsAbsolute"
3426
+ },
3481
3427
  {
3482
3428
  "$ref": "#/definitions/RuleSetConditionsAbsolute"
3483
3429
  }
@@ -3551,6 +3497,68 @@
3551
3497
  }
3552
3498
  ]
3553
3499
  },
3500
+ "RuleSetLogicalConditions": {
3501
+ "description": "Logic operators used in a condition matcher.",
3502
+ "type": "object",
3503
+ "additionalProperties": false,
3504
+ "properties": {
3505
+ "and": {
3506
+ "description": "Logical AND.",
3507
+ "oneOf": [
3508
+ {
3509
+ "$ref": "#/definitions/RuleSetConditions"
3510
+ }
3511
+ ]
3512
+ },
3513
+ "not": {
3514
+ "description": "Logical NOT.",
3515
+ "oneOf": [
3516
+ {
3517
+ "$ref": "#/definitions/RuleSetCondition"
3518
+ }
3519
+ ]
3520
+ },
3521
+ "or": {
3522
+ "description": "Logical OR.",
3523
+ "oneOf": [
3524
+ {
3525
+ "$ref": "#/definitions/RuleSetConditions"
3526
+ }
3527
+ ]
3528
+ }
3529
+ }
3530
+ },
3531
+ "RuleSetLogicalConditionsAbsolute": {
3532
+ "description": "Logic operators used in a condition matcher.",
3533
+ "type": "object",
3534
+ "additionalProperties": false,
3535
+ "properties": {
3536
+ "and": {
3537
+ "description": "Logical AND.",
3538
+ "oneOf": [
3539
+ {
3540
+ "$ref": "#/definitions/RuleSetConditionsAbsolute"
3541
+ }
3542
+ ]
3543
+ },
3544
+ "not": {
3545
+ "description": "Logical NOT.",
3546
+ "oneOf": [
3547
+ {
3548
+ "$ref": "#/definitions/RuleSetConditionAbsolute"
3549
+ }
3550
+ ]
3551
+ },
3552
+ "or": {
3553
+ "description": "Logical OR.",
3554
+ "oneOf": [
3555
+ {
3556
+ "$ref": "#/definitions/RuleSetConditionsAbsolute"
3557
+ }
3558
+ ]
3559
+ }
3560
+ }
3561
+ },
3554
3562
  "RuleSetRule": {
3555
3563
  "description": "A rule description with conditions and effects for modules.",
3556
3564
  "type": "object",
@@ -3720,6 +3728,14 @@
3720
3728
  ]
3721
3729
  }
3722
3730
  },
3731
+ "scheme": {
3732
+ "description": "Match module scheme.",
3733
+ "oneOf": [
3734
+ {
3735
+ "$ref": "#/definitions/RuleSetConditionOrConditions"
3736
+ }
3737
+ ]
3738
+ },
3723
3739
  "sideEffects": {
3724
3740
  "description": "Flags a module as with or without side effects.",
3725
3741
  "type": "boolean"