webpack 5.45.0 → 5.47.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 (31) hide show
  1. package/bin/webpack.js +0 -0
  2. package/lib/NormalModule.js +10 -12
  3. package/lib/NormalModuleFactory.js +2 -8
  4. package/lib/Template.js +1 -4
  5. package/lib/asset/AssetGenerator.js +29 -16
  6. package/lib/asset/AssetModulesPlugin.js +23 -18
  7. package/lib/config/defaults.js +12 -18
  8. package/lib/dependencies/AMDRequireDependency.js +2 -8
  9. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +3 -6
  10. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +2 -4
  11. package/lib/dependencies/HarmonyImportDependency.js +1 -5
  12. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +5 -40
  13. package/lib/dependencies/HarmonyImportSideEffectDependency.js +2 -2
  14. package/lib/dependencies/HarmonyImportSpecifierDependency.js +2 -10
  15. package/lib/dependencies/ModuleDependency.js +1 -8
  16. package/lib/hmr/HotModuleReplacement.runtime.js +66 -60
  17. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -8
  18. package/lib/javascript/JavascriptModulesPlugin.js +51 -30
  19. package/lib/javascript/JavascriptParser.js +9 -14
  20. package/lib/prefetch/ChunkPrefetchStartupRuntimeModule.js +5 -4
  21. package/lib/rules/{ObjectMatcherRulePlugin.js → DescriptionDataMatcherRulePlugin.js} +10 -14
  22. package/lib/runtime/OnChunksLoadedRuntimeModule.js +5 -1
  23. package/lib/schemes/DataUriPlugin.js +7 -6
  24. package/lib/stats/DefaultStatsFactoryPlugin.js +32 -2
  25. package/lib/stats/DefaultStatsPresetPlugin.js +6 -2
  26. package/lib/stats/DefaultStatsPrinterPlugin.js +51 -9
  27. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +2 -2
  28. package/package.json +2 -3
  29. package/schemas/WebpackOptions.check.js +1 -1
  30. package/schemas/WebpackOptions.json +8 -7
  31. package/types.d.ts +68 -41
@@ -3585,13 +3585,6 @@
3585
3585
  "type": "object",
3586
3586
  "additionalProperties": false,
3587
3587
  "properties": {
3588
- "assert": {
3589
- "description": "Match on import assertions of the dependency.",
3590
- "type": "object",
3591
- "additionalProperties": {
3592
- "$ref": "#/definitions/RuleSetConditionOrConditions"
3593
- }
3594
- },
3595
3588
  "compiler": {
3596
3589
  "description": "Match the child compiler name.",
3597
3590
  "oneOf": [
@@ -4217,6 +4210,10 @@
4217
4210
  "description": "Group modules by their type.",
4218
4211
  "type": "boolean"
4219
4212
  },
4213
+ "groupReasonsByOrigin": {
4214
+ "description": "Group reasons by their origin module.",
4215
+ "type": "boolean"
4216
+ },
4220
4217
  "hash": {
4221
4218
  "description": "Add the hash of the compilation.",
4222
4219
  "type": "boolean"
@@ -4321,6 +4318,10 @@
4321
4318
  "description": "Add information about the reasons why modules are included.",
4322
4319
  "type": "boolean"
4323
4320
  },
4321
+ "reasonsSpace": {
4322
+ "description": "Space to display reasons (groups will be collapsed to fit this space).",
4323
+ "type": "number"
4324
+ },
4324
4325
  "relatedAssets": {
4325
4326
  "description": "Add information about assets that are related to other assets (like SourceMaps for assets).",
4326
4327
  "type": "boolean"
package/types.d.ts CHANGED
@@ -1099,6 +1099,11 @@ declare interface ChunkRenderContext {
1099
1099
  * init fragments for the chunk
1100
1100
  */
1101
1101
  chunkInitFragments: InitFragment<ChunkRenderContext>[];
1102
+
1103
+ /**
1104
+ * rendering in strict context
1105
+ */
1106
+ strictMode: boolean;
1102
1107
  }
1103
1108
  declare interface ChunkSizeOptions {
1104
1109
  /**
@@ -1787,7 +1792,9 @@ declare interface CompilationAssets {
1787
1792
  [index: string]: Source;
1788
1793
  }
1789
1794
  declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
1790
- renderModuleContent: SyncWaterfallHook<[Source, Module, RenderContext]>;
1795
+ renderModuleContent: SyncWaterfallHook<
1796
+ [Source, Module, WebAssemblyRenderContext]
1797
+ >;
1791
1798
  }
1792
1799
  declare interface CompilationHooksJavascriptModulesPlugin {
1793
1800
  renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
@@ -4517,7 +4524,7 @@ declare class JavascriptModulesPlugin {
4517
4524
  module: Module,
4518
4525
  renderContext: ChunkRenderContext,
4519
4526
  hooks: CompilationHooksJavascriptModulesPlugin,
4520
- factory: boolean | "strict"
4527
+ factory: boolean
4521
4528
  ): Source;
4522
4529
  renderChunk(
4523
4530
  renderContext: RenderContext,
@@ -4735,44 +4742,21 @@ declare class JavascriptParser extends Parser {
4735
4742
  boolean | void
4736
4743
  >;
4737
4744
  label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
4738
- import: SyncBailHook<[ImportDeclaration, ImportSource], boolean | void>;
4745
+ import: SyncBailHook<[Statement, ImportSource], boolean | void>;
4739
4746
  importSpecifier: SyncBailHook<
4740
- [ImportDeclaration, ImportSource, string, string],
4741
- boolean | void
4742
- >;
4743
- export: SyncBailHook<
4744
- [ExportNamedDeclaration | ExportAllDeclaration],
4745
- boolean | void
4746
- >;
4747
- exportImport: SyncBailHook<
4748
- [ExportNamedDeclaration | ExportAllDeclaration, ImportSource],
4749
- boolean | void
4750
- >;
4751
- exportDeclaration: SyncBailHook<
4752
- [ExportNamedDeclaration | ExportAllDeclaration, Declaration],
4753
- boolean | void
4754
- >;
4755
- exportExpression: SyncBailHook<
4756
- [ExportDefaultDeclaration, Declaration],
4747
+ [Statement, ImportSource, string, string],
4757
4748
  boolean | void
4758
4749
  >;
4750
+ export: SyncBailHook<[Statement], boolean | void>;
4751
+ exportImport: SyncBailHook<[Statement, ImportSource], boolean | void>;
4752
+ exportDeclaration: SyncBailHook<[Statement, Declaration], boolean | void>;
4753
+ exportExpression: SyncBailHook<[Statement, Declaration], boolean | void>;
4759
4754
  exportSpecifier: SyncBailHook<
4760
- [
4761
- ExportNamedDeclaration | ExportAllDeclaration,
4762
- string,
4763
- string,
4764
- undefined | number
4765
- ],
4755
+ [Statement, string, string, undefined | number],
4766
4756
  boolean | void
4767
4757
  >;
4768
4758
  exportImportSpecifier: SyncBailHook<
4769
- [
4770
- ExportNamedDeclaration | ExportAllDeclaration,
4771
- ImportSource,
4772
- string,
4773
- string,
4774
- undefined | number
4775
- ],
4759
+ [Statement, ImportSource, string, string, undefined | number],
4776
4760
  boolean | void
4777
4761
  >;
4778
4762
  preDeclarator: SyncBailHook<
@@ -6155,6 +6139,11 @@ declare interface MainRenderContext {
6155
6139
  * hash to be used for render call
6156
6140
  */
6157
6141
  hash: string;
6142
+
6143
+ /**
6144
+ * rendering in strict context
6145
+ */
6146
+ strictMode: boolean;
6158
6147
  }
6159
6148
  declare abstract class MainTemplate {
6160
6149
  hooks: Readonly<{
@@ -6397,7 +6386,6 @@ declare class ModuleDependency extends Dependency {
6397
6386
  request: string;
6398
6387
  userRequest: string;
6399
6388
  range: any;
6400
- assertions?: Record<string, any>;
6401
6389
  static Template: typeof DependencyTemplate;
6402
6390
  static NO_EXPORTS_REFERENCED: string[][];
6403
6391
  static EXPORTS_OBJECT_REFERENCED: string[][];
@@ -8829,6 +8817,11 @@ declare interface RenderContext {
8829
8817
  * results of code generation
8830
8818
  */
8831
8819
  codeGenerationResults: CodeGenerationResults;
8820
+
8821
+ /**
8822
+ * rendering in strict context
8823
+ */
8824
+ strictMode: boolean;
8832
8825
  }
8833
8826
  type RenderManifestEntry =
8834
8827
  | RenderManifestEntryTemplated
@@ -8954,7 +8947,6 @@ declare interface ResolveData {
8954
8947
  resolveOptions?: ResolveOptionsWebpackOptions;
8955
8948
  context: string;
8956
8949
  request: string;
8957
- assertions?: Record<string, any>;
8958
8950
  dependencies: ModuleDependency[];
8959
8951
  createData: Object;
8960
8952
  fileDependencies: LazySet<string>;
@@ -9366,11 +9358,6 @@ declare interface RuleSetLogicalConditionsAbsolute {
9366
9358
  * A rule description with conditions and effects for modules.
9367
9359
  */
9368
9360
  declare interface RuleSetRule {
9369
- /**
9370
- * Match on import assertions of the dependency.
9371
- */
9372
- assert?: { [index: string]: RuleSetConditionOrConditions };
9373
-
9374
9361
  /**
9375
9362
  * Match the child compiler name.
9376
9363
  */
@@ -10929,6 +10916,11 @@ declare interface StatsOptions {
10929
10916
  */
10930
10917
  groupModulesByType?: boolean;
10931
10918
 
10919
+ /**
10920
+ * Group reasons by their origin module.
10921
+ */
10922
+ groupReasonsByOrigin?: boolean;
10923
+
10932
10924
  /**
10933
10925
  * Add the hash of the compilation.
10934
10926
  */
@@ -11034,6 +11026,11 @@ declare interface StatsOptions {
11034
11026
  */
11035
11027
  reasons?: boolean;
11036
11028
 
11029
+ /**
11030
+ * Space to display reasons (groups will be collapsed to fit this space).
11031
+ */
11032
+ reasonsSpace?: number;
11033
+
11037
11034
  /**
11038
11035
  * Add information about assets that are related to other assets (like SourceMaps for assets).
11039
11036
  */
@@ -11149,7 +11146,6 @@ declare class Template {
11149
11146
  runtimeModules: RuntimeModule[],
11150
11147
  renderContext: RenderContext & {
11151
11148
  codeGenerationResults?: CodeGenerationResults;
11152
- useStrict?: boolean;
11153
11149
  }
11154
11150
  ): Source;
11155
11151
  static renderChunkRuntimeModules(
@@ -11482,6 +11478,37 @@ declare abstract class Watching {
11482
11478
  resume(): void;
11483
11479
  close(callback: CallbackFunction<void>): void;
11484
11480
  }
11481
+ declare interface WebAssemblyRenderContext {
11482
+ /**
11483
+ * the chunk
11484
+ */
11485
+ chunk: Chunk;
11486
+
11487
+ /**
11488
+ * the dependency templates
11489
+ */
11490
+ dependencyTemplates: DependencyTemplates;
11491
+
11492
+ /**
11493
+ * the runtime template
11494
+ */
11495
+ runtimeTemplate: RuntimeTemplate;
11496
+
11497
+ /**
11498
+ * the module graph
11499
+ */
11500
+ moduleGraph: ModuleGraph;
11501
+
11502
+ /**
11503
+ * the chunk graph
11504
+ */
11505
+ chunkGraph: ChunkGraph;
11506
+
11507
+ /**
11508
+ * results of code generation
11509
+ */
11510
+ codeGenerationResults: CodeGenerationResults;
11511
+ }
11485
11512
  declare class WebWorkerTemplatePlugin {
11486
11513
  constructor();
11487
11514