webpack 5.36.2 → 5.38.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.

Potentially problematic release.


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

Files changed (113) hide show
  1. package/README.md +5 -8
  2. package/bin/webpack.js +0 -0
  3. package/lib/CacheFacade.js +3 -3
  4. package/lib/Chunk.js +10 -5
  5. package/lib/Compilation.js +45 -57
  6. package/lib/Compiler.js +9 -6
  7. package/lib/ConcatenationScope.js +2 -1
  8. package/lib/ContextModule.js +3 -3
  9. package/lib/ContextReplacementPlugin.js +4 -3
  10. package/lib/DefinePlugin.js +16 -12
  11. package/lib/EntryPlugin.js +4 -4
  12. package/lib/EvalSourceMapDevToolPlugin.js +3 -1
  13. package/lib/ExportsInfo.js +20 -13
  14. package/lib/FileSystemInfo.js +25 -31
  15. package/lib/FlagDependencyExportsPlugin.js +8 -7
  16. package/lib/FlagDependencyUsagePlugin.js +2 -4
  17. package/lib/HotModuleReplacementPlugin.js +27 -32
  18. package/lib/JavascriptMetaInfoPlugin.js +2 -1
  19. package/lib/MainTemplate.js +2 -3
  20. package/lib/ModuleFilenameHelpers.js +4 -2
  21. package/lib/ModuleGraphConnection.js +6 -2
  22. package/lib/ModuleInfoHeaderPlugin.js +2 -3
  23. package/lib/MultiCompiler.js +31 -27
  24. package/lib/NormalModule.js +42 -8
  25. package/lib/NormalModuleFactory.js +2 -0
  26. package/lib/RecordIdsPlugin.js +5 -4
  27. package/lib/ResolverFactory.js +10 -7
  28. package/lib/RuntimeGlobals.js +7 -0
  29. package/lib/RuntimePlugin.js +19 -1
  30. package/lib/SourceMapDevToolPlugin.js +14 -15
  31. package/lib/Template.js +4 -2
  32. package/lib/Watching.js +91 -47
  33. package/lib/asset/AssetGenerator.js +46 -29
  34. package/lib/asset/AssetModulesPlugin.js +1 -1
  35. package/lib/buildChunkGraph.js +21 -21
  36. package/lib/cache/PackFileCacheStrategy.js +12 -9
  37. package/lib/config/defaults.js +31 -10
  38. package/lib/config/normalization.js +16 -7
  39. package/lib/config/target.js +7 -2
  40. package/lib/debug/ProfilingPlugin.js +4 -3
  41. package/lib/dependencies/AMDRequireDependency.js +3 -3
  42. package/lib/dependencies/CommonJsExportRequireDependency.js +2 -3
  43. package/lib/dependencies/CommonJsExportsParserPlugin.js +3 -1
  44. package/lib/dependencies/CommonJsImportsParserPlugin.js +2 -4
  45. package/lib/dependencies/CommonJsPlugin.js +8 -7
  46. package/lib/dependencies/CommonJsRequireContextDependency.js +2 -1
  47. package/lib/dependencies/ContextDependencyHelpers.js +10 -8
  48. package/lib/dependencies/CreateScriptUrlDependency.js +54 -0
  49. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +11 -13
  50. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +2 -4
  51. package/lib/dependencies/HarmonyImportSpecifierDependency.js +4 -11
  52. package/lib/dependencies/ImportDependency.js +3 -3
  53. package/lib/dependencies/ImportParserPlugin.js +2 -4
  54. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +2 -3
  55. package/lib/dependencies/RequireEnsureDependency.js +3 -3
  56. package/lib/dependencies/WorkerDependency.js +6 -6
  57. package/lib/dependencies/WorkerPlugin.js +32 -20
  58. package/lib/hmr/LazyCompilationPlugin.js +6 -4
  59. package/lib/ids/HashedModuleIdsPlugin.js +3 -3
  60. package/lib/ids/OccurrenceModuleIdsPlugin.js +2 -3
  61. package/lib/index.js +5 -3
  62. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +4 -6
  63. package/lib/javascript/CommonJsChunkFormatPlugin.js +2 -3
  64. package/lib/javascript/JavascriptGenerator.js +3 -1
  65. package/lib/javascript/JavascriptModulesPlugin.js +15 -23
  66. package/lib/javascript/JavascriptParser.js +10 -8
  67. package/lib/library/AssignLibraryPlugin.js +4 -2
  68. package/lib/node/NodeEnvironmentPlugin.js +1 -0
  69. package/lib/node/NodeWatchFileSystem.js +19 -4
  70. package/lib/optimize/AggressiveSplittingPlugin.js +5 -4
  71. package/lib/optimize/ConcatenatedModule.js +31 -27
  72. package/lib/optimize/FlagIncludedChunksPlugin.js +4 -6
  73. package/lib/optimize/InnerGraph.js +9 -11
  74. package/lib/optimize/InnerGraphPlugin.js +3 -1
  75. package/lib/optimize/ModuleConcatenationPlugin.js +7 -10
  76. package/lib/optimize/RealContentHashPlugin.js +14 -16
  77. package/lib/optimize/SideEffectsFlagPlugin.js +6 -5
  78. package/lib/optimize/SplitChunksPlugin.js +13 -15
  79. package/lib/runtime/CreateScriptUrlRuntimeModule.js +61 -0
  80. package/lib/runtime/EnsureChunkRuntimeModule.js +9 -8
  81. package/lib/runtime/LoadScriptRuntimeModule.js +12 -5
  82. package/lib/runtime/OnChunksLoadedRuntimeModule.js +38 -37
  83. package/lib/schemes/DataUriPlugin.js +21 -2
  84. package/lib/serialization/BinaryMiddleware.js +5 -3
  85. package/lib/serialization/FileMiddleware.js +3 -1
  86. package/lib/serialization/ObjectMiddleware.js +11 -7
  87. package/lib/stats/DefaultStatsFactoryPlugin.js +7 -7
  88. package/lib/stats/DefaultStatsPrinterPlugin.js +11 -9
  89. package/lib/stats/StatsFactory.js +2 -1
  90. package/lib/stats/StatsPrinter.js +3 -3
  91. package/lib/util/LazyBucketSortedSet.js +3 -3
  92. package/lib/util/cleverMerge.js +3 -1
  93. package/lib/util/comparators.js +13 -13
  94. package/lib/util/createHash.js +5 -4
  95. package/lib/util/fs.js +8 -8
  96. package/lib/util/identifier.js +2 -1
  97. package/lib/util/internalSerializables.js +2 -0
  98. package/lib/util/serialization.js +108 -59
  99. package/lib/validateSchema.js +5 -3
  100. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +4 -4
  101. package/lib/wasm-sync/WasmFinalizeExportsPlugin.js +5 -4
  102. package/lib/wasm-sync/WebAssemblyGenerator.js +89 -83
  103. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +2 -1
  104. package/lib/wasm-sync/WebAssemblyParser.js +6 -5
  105. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -4
  106. package/lib/webpack.js +11 -7
  107. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +13 -1
  108. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +14 -4
  109. package/package.json +10 -7
  110. package/schemas/WebpackOptions.check.js +1 -1
  111. package/schemas/WebpackOptions.json +107 -60
  112. package/types.d.ts +480 -285
  113. package/lib/util/DataURI.js +0 -32
@@ -2686,6 +2686,22 @@
2686
2686
  "strictModuleExceptionHandling": {
2687
2687
  "$ref": "#/definitions/StrictModuleExceptionHandling"
2688
2688
  },
2689
+ "trustedTypes": {
2690
+ "description": "Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.",
2691
+ "anyOf": [
2692
+ {
2693
+ "enum": [true]
2694
+ },
2695
+ {
2696
+ "description": "The name of the Trusted Types policy created by webpack to serve bundle chunks.",
2697
+ "type": "string",
2698
+ "minLength": 1
2699
+ },
2700
+ {
2701
+ "$ref": "#/definitions/TrustedTypes"
2702
+ }
2703
+ ]
2704
+ },
2689
2705
  "umdNamedDefine": {
2690
2706
  "cli": {
2691
2707
  "exclude": true
@@ -2839,6 +2855,9 @@
2839
2855
  "strictModuleExceptionHandling": {
2840
2856
  "$ref": "#/definitions/StrictModuleExceptionHandling"
2841
2857
  },
2858
+ "trustedTypes": {
2859
+ "$ref": "#/definitions/TrustedTypes"
2860
+ },
2842
2861
  "uniqueName": {
2843
2862
  "$ref": "#/definitions/UniqueName"
2844
2863
  },
@@ -3372,40 +3391,13 @@
3372
3391
  {
3373
3392
  "type": "string"
3374
3393
  },
3375
- {
3376
- "type": "object",
3377
- "additionalProperties": false,
3378
- "properties": {
3379
- "and": {
3380
- "description": "Logical AND.",
3381
- "oneOf": [
3382
- {
3383
- "$ref": "#/definitions/RuleSetConditions"
3384
- }
3385
- ]
3386
- },
3387
- "not": {
3388
- "description": "Logical NOT.",
3389
- "oneOf": [
3390
- {
3391
- "$ref": "#/definitions/RuleSetConditions"
3392
- }
3393
- ]
3394
- },
3395
- "or": {
3396
- "description": "Logical OR.",
3397
- "oneOf": [
3398
- {
3399
- "$ref": "#/definitions/RuleSetConditions"
3400
- }
3401
- ]
3402
- }
3403
- }
3404
- },
3405
3394
  {
3406
3395
  "instanceof": "Function",
3407
3396
  "tsType": "((value: string) => boolean)"
3408
3397
  },
3398
+ {
3399
+ "$ref": "#/definitions/RuleSetLogicalConditions"
3400
+ },
3409
3401
  {
3410
3402
  "$ref": "#/definitions/RuleSetConditions"
3411
3403
  }
@@ -3425,40 +3417,13 @@
3425
3417
  "type": "string",
3426
3418
  "absolutePath": true
3427
3419
  },
3428
- {
3429
- "type": "object",
3430
- "additionalProperties": false,
3431
- "properties": {
3432
- "and": {
3433
- "description": "Logical AND.",
3434
- "oneOf": [
3435
- {
3436
- "$ref": "#/definitions/RuleSetConditionsAbsolute"
3437
- }
3438
- ]
3439
- },
3440
- "not": {
3441
- "description": "Logical NOT.",
3442
- "oneOf": [
3443
- {
3444
- "$ref": "#/definitions/RuleSetConditionsAbsolute"
3445
- }
3446
- ]
3447
- },
3448
- "or": {
3449
- "description": "Logical OR.",
3450
- "oneOf": [
3451
- {
3452
- "$ref": "#/definitions/RuleSetConditionsAbsolute"
3453
- }
3454
- ]
3455
- }
3456
- }
3457
- },
3458
3420
  {
3459
3421
  "instanceof": "Function",
3460
3422
  "tsType": "((value: string) => boolean)"
3461
3423
  },
3424
+ {
3425
+ "$ref": "#/definitions/RuleSetLogicalConditionsAbsolute"
3426
+ },
3462
3427
  {
3463
3428
  "$ref": "#/definitions/RuleSetConditionsAbsolute"
3464
3429
  }
@@ -3532,6 +3497,68 @@
3532
3497
  }
3533
3498
  ]
3534
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
+ },
3535
3562
  "RuleSetRule": {
3536
3563
  "description": "A rule description with conditions and effects for modules.",
3537
3564
  "type": "object",
@@ -3701,6 +3728,14 @@
3701
3728
  ]
3702
3729
  }
3703
3730
  },
3731
+ "scheme": {
3732
+ "description": "Match module scheme.",
3733
+ "oneOf": [
3734
+ {
3735
+ "$ref": "#/definitions/RuleSetConditionOrConditions"
3736
+ }
3737
+ ]
3738
+ },
3704
3739
  "sideEffects": {
3705
3740
  "description": "Flags a module as with or without side effects.",
3706
3741
  "type": "boolean"
@@ -4356,6 +4391,18 @@
4356
4391
  }
4357
4392
  ]
4358
4393
  },
4394
+ "TrustedTypes": {
4395
+ "description": "Use a Trusted Types policy to create urls for chunks.",
4396
+ "type": "object",
4397
+ "additionalProperties": false,
4398
+ "properties": {
4399
+ "policyName": {
4400
+ "description": "The name of the Trusted Types policy created by webpack to serve bundle chunks.",
4401
+ "type": "string",
4402
+ "minLength": 1
4403
+ }
4404
+ }
4405
+ },
4359
4406
  "UmdNamedDefine": {
4360
4407
  "description": "If `output.libraryTarget` is set to umd and `output.library` is set, setting this to true will name the AMD module.",
4361
4408
  "type": "boolean"