webpack 5.40.0 → 5.42.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 (50) hide show
  1. package/README.md +3 -3
  2. package/bin/webpack.js +0 -0
  3. package/lib/Compiler.js +14 -1
  4. package/lib/ConditionalInitFragment.js +15 -12
  5. package/lib/DependencyTemplate.js +3 -2
  6. package/lib/ExternalModule.js +213 -33
  7. package/lib/ExternalModuleFactoryPlugin.js +2 -1
  8. package/lib/InitFragment.js +10 -7
  9. package/lib/MainTemplate.js +1 -1
  10. package/lib/ModuleTemplate.js +0 -9
  11. package/lib/NormalModuleFactory.js +13 -2
  12. package/lib/RuntimeTemplate.js +8 -0
  13. package/lib/Template.js +3 -2
  14. package/lib/TemplatedPathPlugin.js +24 -26
  15. package/lib/Watching.js +2 -1
  16. package/lib/WebpackOptionsApply.js +12 -8
  17. package/lib/asset/AssetGenerator.js +2 -2
  18. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -1
  19. package/lib/cache/IdleFileCachePlugin.js +60 -13
  20. package/lib/cache/PackFileCacheStrategy.js +26 -15
  21. package/lib/config/defaults.js +54 -12
  22. package/lib/config/normalization.js +2 -0
  23. package/lib/dependencies/HarmonyExportInitFragment.js +4 -1
  24. package/lib/dependencies/WorkerPlugin.js +25 -10
  25. package/lib/electron/ElectronTargetPlugin.js +3 -3
  26. package/lib/esm/ModuleChunkFormatPlugin.js +97 -0
  27. package/lib/esm/ModuleChunkLoadingPlugin.js +63 -0
  28. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +208 -0
  29. package/lib/hmr/lazyCompilationBackend.js +17 -1
  30. package/lib/javascript/EnableChunkLoadingPlugin.js +5 -3
  31. package/lib/javascript/JavascriptModulesPlugin.js +80 -17
  32. package/lib/javascript/JavascriptParser.js +2 -1
  33. package/lib/json/JsonGenerator.js +2 -2
  34. package/lib/node/NodeTargetPlugin.js +1 -1
  35. package/lib/node/ReadFileCompileAsyncWasmPlugin.js +44 -22
  36. package/lib/optimize/ModuleConcatenationPlugin.js +1 -1
  37. package/lib/runtime/AsyncModuleRuntimeModule.js +8 -4
  38. package/lib/serialization/BinaryMiddleware.js +50 -35
  39. package/lib/serialization/FileMiddleware.js +112 -12
  40. package/lib/wasm/EnableWasmLoadingPlugin.js +10 -1
  41. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +1 -1
  42. package/package.json +15 -15
  43. package/schemas/WebpackOptions.check.js +1 -1
  44. package/schemas/WebpackOptions.json +22 -8
  45. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  46. package/schemas/plugins/container/ContainerReferencePlugin.json +2 -1
  47. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  48. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  49. package/schemas/plugins/container/ModuleFederationPlugin.json +2 -1
  50. package/types.d.ts +105 -151
package/types.d.ts CHANGED
@@ -52,15 +52,16 @@ import {
52
52
  NewExpression,
53
53
  ObjectExpression,
54
54
  ObjectPattern,
55
+ PrivateIdentifier,
55
56
  Program,
56
57
  Property,
58
+ PropertyDefinition,
57
59
  RegExpLiteral,
58
60
  RestElement,
59
61
  ReturnStatement,
60
62
  SequenceExpression,
61
63
  SimpleCallExpression,
62
64
  SimpleLiteral,
63
- SourceLocation,
64
65
  SpreadElement,
65
66
  Super,
66
67
  SwitchCase,
@@ -118,11 +119,11 @@ declare class AbstractLibraryPlugin<T> {
118
119
  ): void;
119
120
  embedInRuntimeBailout(
120
121
  module: Module,
121
- renderContext: RenderContextObject,
122
+ renderContext: RenderContext,
122
123
  libraryContext: LibraryContext<T>
123
124
  ): undefined | string;
124
125
  strictRuntimeBailout(
125
- renderContext: RenderContextObject,
126
+ renderContext: RenderContext,
126
127
  libraryContext: LibraryContext<T>
127
128
  ): undefined | string;
128
129
  runtimeRequirements(
@@ -132,7 +133,7 @@ declare class AbstractLibraryPlugin<T> {
132
133
  ): void;
133
134
  render(
134
135
  source: Source,
135
- renderContext: RenderContextObject,
136
+ renderContext: RenderContext,
136
137
  libraryContext: LibraryContext<T>
137
138
  ): Source;
138
139
  renderStartup(
@@ -1062,6 +1063,42 @@ declare class ChunkPrefetchPreloadPlugin {
1062
1063
  constructor();
1063
1064
  apply(compiler: Compiler): void;
1064
1065
  }
1066
+ declare interface ChunkRenderContext {
1067
+ /**
1068
+ * the chunk
1069
+ */
1070
+ chunk: Chunk;
1071
+
1072
+ /**
1073
+ * the dependency templates
1074
+ */
1075
+ dependencyTemplates: DependencyTemplates;
1076
+
1077
+ /**
1078
+ * the runtime template
1079
+ */
1080
+ runtimeTemplate: RuntimeTemplate;
1081
+
1082
+ /**
1083
+ * the module graph
1084
+ */
1085
+ moduleGraph: ModuleGraph;
1086
+
1087
+ /**
1088
+ * the chunk graph
1089
+ */
1090
+ chunkGraph: ChunkGraph;
1091
+
1092
+ /**
1093
+ * results of code generation
1094
+ */
1095
+ codeGenerationResults: CodeGenerationResults;
1096
+
1097
+ /**
1098
+ * init fragments for the chunk
1099
+ */
1100
+ chunkInitFragments: InitFragment<ChunkRenderContext>[];
1101
+ }
1065
1102
  declare interface ChunkSizeOptions {
1066
1103
  /**
1067
1104
  * constant overhead for a chunk
@@ -1749,27 +1786,28 @@ declare interface CompilationAssets {
1749
1786
  [index: string]: Source;
1750
1787
  }
1751
1788
  declare interface CompilationHooksAsyncWebAssemblyModulesPlugin {
1752
- renderModuleContent: SyncWaterfallHook<[Source, Module, RenderContextObject]>;
1789
+ renderModuleContent: SyncWaterfallHook<[Source, Module, RenderContext]>;
1753
1790
  }
1754
1791
  declare interface CompilationHooksJavascriptModulesPlugin {
1755
- renderModuleContent: SyncWaterfallHook<[Source, Module, RenderContextObject]>;
1792
+ renderModuleContent: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
1756
1793
  renderModuleContainer: SyncWaterfallHook<
1757
- [Source, Module, RenderContextObject]
1794
+ [Source, Module, ChunkRenderContext]
1758
1795
  >;
1759
- renderModulePackage: SyncWaterfallHook<[Source, Module, RenderContextObject]>;
1760
- renderChunk: SyncWaterfallHook<[Source, RenderContextObject]>;
1761
- renderMain: SyncWaterfallHook<[Source, RenderContextObject]>;
1762
- render: SyncWaterfallHook<[Source, RenderContextObject]>;
1796
+ renderModulePackage: SyncWaterfallHook<[Source, Module, ChunkRenderContext]>;
1797
+ renderChunk: SyncWaterfallHook<[Source, RenderContext]>;
1798
+ renderMain: SyncWaterfallHook<[Source, RenderContext]>;
1799
+ renderContent: SyncWaterfallHook<[Source, RenderContext]>;
1800
+ render: SyncWaterfallHook<[Source, RenderContext]>;
1763
1801
  renderStartup: SyncWaterfallHook<[Source, Module, StartupRenderContext]>;
1764
1802
  renderRequire: SyncWaterfallHook<[string, RenderBootstrapContext]>;
1765
1803
  inlineInRuntimeBailout: SyncBailHook<
1766
1804
  [Module, RenderBootstrapContext],
1767
1805
  string
1768
1806
  >;
1769
- embedInRuntimeBailout: SyncBailHook<[Module, RenderContextObject], string>;
1770
- strictRuntimeBailout: SyncBailHook<[RenderContextObject], string>;
1807
+ embedInRuntimeBailout: SyncBailHook<[Module, RenderContext], string>;
1808
+ strictRuntimeBailout: SyncBailHook<[RenderContext], string>;
1771
1809
  chunkHash: SyncHook<[Chunk, Hash, ChunkHashContext]>;
1772
- useSourceMap: SyncBailHook<[Chunk, RenderContextObject], boolean>;
1810
+ useSourceMap: SyncBailHook<[Chunk, RenderContext], boolean>;
1773
1811
  }
1774
1812
  declare interface CompilationHooksRealContentHashPlugin {
1775
1813
  updateHash: SyncBailHook<[Buffer[], string], string>;
@@ -2017,7 +2055,8 @@ declare interface Configuration {
2017
2055
  | "system"
2018
2056
  | "promise"
2019
2057
  | "import"
2020
- | "script";
2058
+ | "script"
2059
+ | "node-commonjs";
2021
2060
 
2022
2061
  /**
2023
2062
  * Ignore specific warnings.
@@ -2576,7 +2615,7 @@ declare interface DependencyTemplateContext {
2576
2615
  /**
2577
2616
  * mutable array of init fragments for the current module
2578
2617
  */
2579
- initFragments: InitFragment[];
2618
+ initFragments: InitFragment<GenerateContext>[];
2580
2619
 
2581
2620
  /**
2582
2621
  * when in a concatenated module, information about other concatenated modules
@@ -2910,7 +2949,7 @@ declare abstract class EntryDependency extends ModuleDependency {}
2910
2949
  */
2911
2950
  declare interface EntryDescription {
2912
2951
  /**
2913
- * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
2952
+ * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
2914
2953
  */
2915
2954
  chunkLoading?: string | false;
2916
2955
 
@@ -2960,7 +2999,7 @@ declare interface EntryDescription {
2960
2999
  */
2961
3000
  declare interface EntryDescriptionNormalized {
2962
3001
  /**
2963
- * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
3002
+ * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
2964
3003
  */
2965
3004
  chunkLoading?: string | false;
2966
3005
 
@@ -3579,6 +3618,11 @@ declare interface ExternalItemFunctionData {
3579
3618
  */
3580
3619
  contextInfo?: ModuleFactoryCreateDataContextInfo;
3581
3620
 
3621
+ /**
3622
+ * The category of the referencing dependencies.
3623
+ */
3624
+ dependencyType?: string;
3625
+
3582
3626
  /**
3583
3627
  * Get a resolve function with the current resolver options.
3584
3628
  */
@@ -3622,11 +3666,6 @@ declare class ExternalModule extends Module {
3622
3666
  request: string | string[] | Record<string, string | string[]>;
3623
3667
  externalType: string;
3624
3668
  userRequest: string;
3625
- getSourceData(
3626
- runtimeTemplate?: any,
3627
- moduleGraph?: any,
3628
- chunkGraph?: any
3629
- ): SourceData;
3630
3669
  }
3631
3670
  declare interface ExternalModuleInfo {
3632
3671
  index: number;
@@ -3719,7 +3758,8 @@ type ExternalsType =
3719
3758
  | "system"
3720
3759
  | "promise"
3721
3760
  | "import"
3722
- | "script";
3761
+ | "script"
3762
+ | "node-commonjs";
3723
3763
  declare interface FactorizeModuleOptions {
3724
3764
  currentProfile: ModuleProfile;
3725
3765
  factory: ModuleFactory;
@@ -3778,18 +3818,28 @@ declare interface FileCacheOptions {
3778
3818
  */
3779
3819
  cacheLocation?: string;
3780
3820
 
3821
+ /**
3822
+ * Compression type used for the cache files.
3823
+ */
3824
+ compression?: false | "gzip" | "brotli";
3825
+
3781
3826
  /**
3782
3827
  * Algorithm used for generation the hash (see node.js crypto package).
3783
3828
  */
3784
3829
  hashAlgorithm?: string;
3785
3830
 
3786
3831
  /**
3787
- * Time in ms after which idle period the cache storing should happen (only for store: 'pack').
3832
+ * Time in ms after which idle period the cache storing should happen.
3788
3833
  */
3789
3834
  idleTimeout?: number;
3790
3835
 
3791
3836
  /**
3792
- * Time in ms after which idle period the initial cache storing should happen (only for store: 'pack').
3837
+ * Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).
3838
+ */
3839
+ idleTimeoutAfterLargeChanges?: number;
3840
+
3841
+ /**
3842
+ * Time in ms after which idle period the initial cache storing should happen.
3793
3843
  */
3794
3844
  idleTimeoutForInitialStore?: number;
3795
3845
 
@@ -4363,14 +4413,14 @@ declare interface InfrastructureLogging {
4363
4413
  */
4364
4414
  stream?: NodeJS.WritableStream;
4365
4415
  }
4366
- declare abstract class InitFragment {
4416
+ declare abstract class InitFragment<Context> {
4367
4417
  content: string | Source;
4368
4418
  stage: number;
4369
4419
  position: number;
4370
4420
  key?: string;
4371
4421
  endContent?: string | Source;
4372
- getContent(generateContext: GenerateContext): string | Source;
4373
- getEndContent(generateContext: GenerateContext): undefined | string | Source;
4422
+ getContent(context: Context): string | Source;
4423
+ getEndContent(context: Context): undefined | string | Source;
4374
4424
  merge: any;
4375
4425
  }
4376
4426
  declare interface InputFileSystem {
@@ -4457,12 +4507,12 @@ declare class JavascriptModulesPlugin {
4457
4507
  apply(compiler: Compiler): void;
4458
4508
  renderModule(
4459
4509
  module: Module,
4460
- renderContext: RenderContextObject,
4510
+ renderContext: ChunkRenderContext,
4461
4511
  hooks: CompilationHooksJavascriptModulesPlugin,
4462
4512
  factory: boolean | "strict"
4463
4513
  ): Source;
4464
4514
  renderChunk(
4465
- renderContext: RenderContextObject,
4515
+ renderContext: RenderContext,
4466
4516
  hooks: CompilationHooksJavascriptModulesPlugin
4467
4517
  ): Source;
4468
4518
  renderMain(
@@ -4559,7 +4609,7 @@ declare class JavascriptParser extends Parser {
4559
4609
  | FunctionDeclaration
4560
4610
  | VariableDeclaration
4561
4611
  | ClassDeclaration
4562
- | PrivateIdentifierNode
4612
+ | PrivateIdentifier
4563
4613
  ),
4564
4614
  number
4565
4615
  ],
@@ -4663,7 +4713,7 @@ declare class JavascriptParser extends Parser {
4663
4713
  >;
4664
4714
  classBodyElement: SyncBailHook<
4665
4715
  [
4666
- MethodDefinition | PropertyDefinitionNode,
4716
+ MethodDefinition | PropertyDefinition,
4667
4717
  ClassExpression | ClassDeclaration
4668
4718
  ],
4669
4719
  boolean | void
@@ -4671,7 +4721,7 @@ declare class JavascriptParser extends Parser {
4671
4721
  classBodyValue: SyncBailHook<
4672
4722
  [
4673
4723
  Expression,
4674
- MethodDefinition | PropertyDefinitionNode,
4724
+ MethodDefinition | PropertyDefinition,
4675
4725
  ClassExpression | ClassDeclaration
4676
4726
  ],
4677
4727
  boolean | void
@@ -4987,7 +5037,7 @@ declare class JavascriptParser extends Parser {
4987
5037
  | FunctionDeclaration
4988
5038
  | VariableDeclaration
4989
5039
  | ClassDeclaration
4990
- | PrivateIdentifierNode,
5040
+ | PrivateIdentifier,
4991
5041
  commentsStartPos: number
4992
5042
  ): boolean;
4993
5043
  getComments(range?: any): any[];
@@ -6397,7 +6447,8 @@ declare interface ModuleFederationPluginOptions {
6397
6447
  | "system"
6398
6448
  | "promise"
6399
6449
  | "import"
6400
- | "script";
6450
+ | "script"
6451
+ | "node-commonjs";
6401
6452
 
6402
6453
  /**
6403
6454
  * Container locations and request scopes from which modules should be resolved and loaded at runtime. When provided, property name is used as request scope, otherwise request scope is automatically inferred from container location.
@@ -6922,6 +6973,7 @@ type NodeEstreeIndex =
6922
6973
  | FunctionDeclaration
6923
6974
  | VariableDeclaration
6924
6975
  | ClassDeclaration
6976
+ | PrivateIdentifier
6925
6977
  | ExpressionStatement
6926
6978
  | BlockStatement
6927
6979
  | EmptyStatement
@@ -6945,6 +6997,7 @@ type NodeEstreeIndex =
6945
6997
  | ExportDefaultDeclaration
6946
6998
  | ExportAllDeclaration
6947
6999
  | MethodDefinition
7000
+ | PropertyDefinition
6948
7001
  | VariableDeclarator
6949
7002
  | Program
6950
7003
  | Super
@@ -7150,6 +7203,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
7150
7203
  fs: InputFileSystem;
7151
7204
  parserCache: Map<string, WeakMap<Object, any>>;
7152
7205
  generatorCache: Map<string, WeakMap<Object, Generator>>;
7206
+ cleanupForCache(): void;
7153
7207
  resolveResource(
7154
7208
  contextInfo?: any,
7155
7209
  context?: any,
@@ -7746,7 +7800,7 @@ declare interface Output {
7746
7800
  | ((pathData: PathData, assetInfo?: AssetInfo) => string);
7747
7801
 
7748
7802
  /**
7749
- * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
7803
+ * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
7750
7804
  */
7751
7805
  chunkFormat?: string | false;
7752
7806
 
@@ -7756,7 +7810,7 @@ declare interface Output {
7756
7810
  chunkLoadTimeout?: number;
7757
7811
 
7758
7812
  /**
7759
- * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
7813
+ * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
7760
7814
  */
7761
7815
  chunkLoading?: string | false;
7762
7816
 
@@ -7961,7 +8015,7 @@ declare interface Output {
7961
8015
  webassemblyModuleFilename?: string;
7962
8016
 
7963
8017
  /**
7964
- * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
8018
+ * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
7965
8019
  */
7966
8020
  workerChunkLoading?: string | false;
7967
8021
 
@@ -8032,7 +8086,7 @@ declare interface OutputNormalized {
8032
8086
  | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8033
8087
 
8034
8088
  /**
8035
- * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
8089
+ * The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).
8036
8090
  */
8037
8091
  chunkFormat?: string | false;
8038
8092
 
@@ -8042,7 +8096,7 @@ declare interface OutputNormalized {
8042
8096
  chunkLoadTimeout?: number;
8043
8097
 
8044
8098
  /**
8045
- * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
8099
+ * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
8046
8100
  */
8047
8101
  chunkLoading?: string | false;
8048
8102
 
@@ -8232,7 +8286,7 @@ declare interface OutputNormalized {
8232
8286
  webassemblyModuleFilename?: string;
8233
8287
 
8234
8288
  /**
8235
- * The method of loading chunks (methods included by default are 'jsonp' (web), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
8289
+ * The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
8236
8290
  */
8237
8291
  workerChunkLoading?: string | false;
8238
8292
 
@@ -8411,12 +8465,6 @@ declare interface PrintedElement {
8411
8465
  element: string;
8412
8466
  content: string;
8413
8467
  }
8414
- declare interface PrivateIdentifierNode {
8415
- type: "PrivateIdentifier";
8416
- name: string;
8417
- loc?: null | SourceLocation;
8418
- range?: [number, number];
8419
- }
8420
8468
  declare interface Problem {
8421
8469
  type: ProblemType;
8422
8470
  path: string;
@@ -8534,71 +8582,6 @@ declare interface ProgressPluginOptions {
8534
8582
  */
8535
8583
  profile?: null | boolean;
8536
8584
  }
8537
- declare interface PropertyDefinitionNode {
8538
- type: "PropertyDefinition";
8539
- key:
8540
- | UnaryExpression
8541
- | ThisExpression
8542
- | ArrayExpression
8543
- | ObjectExpression
8544
- | FunctionExpression
8545
- | ArrowFunctionExpression
8546
- | YieldExpression
8547
- | SimpleLiteral
8548
- | RegExpLiteral
8549
- | BigIntLiteral
8550
- | UpdateExpression
8551
- | BinaryExpression
8552
- | AssignmentExpression
8553
- | LogicalExpression
8554
- | MemberExpression
8555
- | ConditionalExpression
8556
- | SimpleCallExpression
8557
- | NewExpression
8558
- | SequenceExpression
8559
- | TemplateLiteral
8560
- | TaggedTemplateExpression
8561
- | ClassExpression
8562
- | MetaProperty
8563
- | Identifier
8564
- | AwaitExpression
8565
- | ImportExpression
8566
- | ChainExpression
8567
- | PrivateIdentifierNode;
8568
- value:
8569
- | null
8570
- | UnaryExpression
8571
- | ThisExpression
8572
- | ArrayExpression
8573
- | ObjectExpression
8574
- | FunctionExpression
8575
- | ArrowFunctionExpression
8576
- | YieldExpression
8577
- | SimpleLiteral
8578
- | RegExpLiteral
8579
- | BigIntLiteral
8580
- | UpdateExpression
8581
- | BinaryExpression
8582
- | AssignmentExpression
8583
- | LogicalExpression
8584
- | MemberExpression
8585
- | ConditionalExpression
8586
- | SimpleCallExpression
8587
- | NewExpression
8588
- | SequenceExpression
8589
- | TemplateLiteral
8590
- | TaggedTemplateExpression
8591
- | ClassExpression
8592
- | MetaProperty
8593
- | Identifier
8594
- | AwaitExpression
8595
- | ImportExpression
8596
- | ChainExpression;
8597
- computed: boolean;
8598
- static: boolean;
8599
- loc?: null | SourceLocation;
8600
- range?: [number, number];
8601
- }
8602
8585
  declare class ProvidePlugin {
8603
8586
  constructor(definitions: Record<string, string | string[]>);
8604
8587
  definitions: Record<string, string | string[]>;
@@ -8779,33 +8762,7 @@ declare interface RenderBootstrapContext {
8779
8762
  */
8780
8763
  hash: string;
8781
8764
  }
8782
- declare interface RenderContextModuleTemplate {
8783
- /**
8784
- * the chunk
8785
- */
8786
- chunk: Chunk;
8787
-
8788
- /**
8789
- * the dependency templates
8790
- */
8791
- dependencyTemplates: DependencyTemplates;
8792
-
8793
- /**
8794
- * the runtime template
8795
- */
8796
- runtimeTemplate: RuntimeTemplate;
8797
-
8798
- /**
8799
- * the module graph
8800
- */
8801
- moduleGraph: ModuleGraph;
8802
-
8803
- /**
8804
- * the chunk graph
8805
- */
8806
- chunkGraph: ChunkGraph;
8807
- }
8808
- declare interface RenderContextObject {
8765
+ declare interface RenderContext {
8809
8766
  /**
8810
8767
  * the chunk
8811
8768
  */
@@ -9739,6 +9696,7 @@ declare abstract class RuntimeTemplate {
9739
9696
  expressionFunction(expression?: any, args?: string): string;
9740
9697
  emptyFunction(): "x => {}" | "function() {}";
9741
9698
  destructureArray(items?: any, value?: any): string;
9699
+ destructureObject(items?: any, value?: any): string;
9742
9700
  iife(args?: any, body?: any): string;
9743
9701
  forEach(variable?: any, array?: any, body?: any): string;
9744
9702
 
@@ -10037,7 +9995,7 @@ declare abstract class RuntimeTemplate {
10037
9995
  /**
10038
9996
  * init fragments will be added here
10039
9997
  */
10040
- initFragments: InitFragment[];
9998
+ initFragments: InitFragment<any>[];
10041
9999
  /**
10042
10000
  * runtime for which this code will be generated
10043
10001
  */
@@ -10401,11 +10359,6 @@ declare class Source {
10401
10359
  source(): string | Buffer;
10402
10360
  buffer(): Buffer;
10403
10361
  }
10404
- declare interface SourceData {
10405
- iife?: boolean;
10406
- init?: string;
10407
- expression: string;
10408
- }
10409
10362
  declare interface SourceLike {
10410
10363
  source(): string | Buffer;
10411
10364
  }
@@ -10577,7 +10530,7 @@ declare abstract class StackedMap<K, V> {
10577
10530
  readonly size: number;
10578
10531
  createChild(): StackedMap<K, V>;
10579
10532
  }
10580
- type StartupRenderContext = RenderContextObject & { inlined: boolean };
10533
+ type StartupRenderContext = RenderContext & { inlined: boolean };
10581
10534
  type Statement =
10582
10535
  | FunctionDeclaration
10583
10536
  | VariableDeclaration
@@ -11144,21 +11097,21 @@ declare class Template {
11144
11097
  static asString(str: string | string[]): string;
11145
11098
  static getModulesArrayBounds(modules: WithId[]): false | [number, number];
11146
11099
  static renderChunkModules(
11147
- renderContext: RenderContextModuleTemplate,
11100
+ renderContext: ChunkRenderContext,
11148
11101
  modules: Module[],
11149
11102
  renderModule: (arg0: Module) => Source,
11150
11103
  prefix?: string
11151
11104
  ): Source;
11152
11105
  static renderRuntimeModules(
11153
11106
  runtimeModules: RuntimeModule[],
11154
- renderContext: RenderContextModuleTemplate & {
11107
+ renderContext: RenderContext & {
11155
11108
  codeGenerationResults?: CodeGenerationResults;
11156
11109
  useStrict?: boolean;
11157
11110
  }
11158
11111
  ): Source;
11159
11112
  static renderChunkRuntimeModules(
11160
11113
  runtimeModules: RuntimeModule[],
11161
- renderContext: RenderContextModuleTemplate
11114
+ renderContext: RenderContext
11162
11115
  ): Source;
11163
11116
  static NUMBER_OF_IDENTIFIER_START_CHARS: number;
11164
11117
  static NUMBER_OF_IDENTIFIER_CONTINUATION_CHARS: number;
@@ -11636,7 +11589,8 @@ declare interface WebpackOptionsNormalized {
11636
11589
  | "system"
11637
11590
  | "promise"
11638
11591
  | "import"
11639
- | "script";
11592
+ | "script"
11593
+ | "node-commonjs";
11640
11594
 
11641
11595
  /**
11642
11596
  * Ignore specific warnings.