webpack 5.103.0 → 5.104.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.
Files changed (177) hide show
  1. package/hot/dev-server.js +18 -3
  2. package/hot/emitter-event-target.js +7 -0
  3. package/hot/lazy-compilation-node.js +45 -29
  4. package/hot/lazy-compilation-universal.js +18 -0
  5. package/hot/lazy-compilation-web.js +15 -5
  6. package/hot/load-http.js +7 -0
  7. package/hot/only-dev-server.js +19 -4
  8. package/lib/APIPlugin.js +6 -0
  9. package/lib/Chunk.js +1 -1
  10. package/lib/ChunkGraph.js +9 -7
  11. package/lib/ChunkGroup.js +8 -5
  12. package/lib/CleanPlugin.js +6 -3
  13. package/lib/CodeGenerationResults.js +2 -1
  14. package/lib/CompatibilityPlugin.js +3 -0
  15. package/lib/Compilation.js +33 -19
  16. package/lib/Compiler.js +3 -3
  17. package/lib/ContextModule.js +6 -3
  18. package/lib/ContextModuleFactory.js +6 -4
  19. package/lib/DefinePlugin.js +34 -3
  20. package/lib/DelegatedModule.js +7 -4
  21. package/lib/DllModule.js +6 -3
  22. package/lib/DotenvPlugin.js +11 -6
  23. package/lib/ExportsInfo.js +5 -5
  24. package/lib/ExternalModule.js +8 -7
  25. package/lib/ExternalModuleFactoryPlugin.js +1 -1
  26. package/lib/FileSystemInfo.js +1 -1
  27. package/lib/Generator.js +10 -7
  28. package/lib/HookWebpackError.js +33 -4
  29. package/lib/HotModuleReplacementPlugin.js +22 -0
  30. package/lib/ManifestPlugin.js +1 -1
  31. package/lib/Module.js +24 -15
  32. package/lib/ModuleBuildError.js +1 -1
  33. package/lib/ModuleError.js +1 -1
  34. package/lib/ModuleFilenameHelpers.js +1 -1
  35. package/lib/ModuleGraph.js +27 -12
  36. package/lib/ModuleGraphConnection.js +2 -2
  37. package/lib/ModuleSourceTypeConstants.js +189 -0
  38. package/lib/ModuleTypeConstants.js +1 -4
  39. package/lib/ModuleWarning.js +1 -1
  40. package/lib/NodeStuffPlugin.js +52 -42
  41. package/lib/NormalModule.js +6 -4
  42. package/lib/NormalModuleFactory.js +7 -10
  43. package/lib/Parser.js +1 -1
  44. package/lib/RawModule.js +7 -4
  45. package/lib/RuntimeModule.js +1 -1
  46. package/lib/RuntimeTemplate.js +5 -1
  47. package/lib/SizeFormatHelpers.js +1 -1
  48. package/lib/SourceMapDevToolPlugin.js +6 -1
  49. package/lib/Template.js +17 -6
  50. package/lib/TemplatedPathPlugin.js +5 -6
  51. package/lib/WebpackError.js +0 -1
  52. package/lib/WebpackOptionsApply.js +37 -9
  53. package/lib/asset/AssetBytesGenerator.js +15 -11
  54. package/lib/asset/AssetGenerator.js +30 -24
  55. package/lib/asset/AssetSourceGenerator.js +15 -11
  56. package/lib/asset/RawDataUrlModule.js +6 -3
  57. package/lib/buildChunkGraph.js +4 -2
  58. package/lib/cache/PackFileCacheStrategy.js +6 -5
  59. package/lib/cli.js +2 -43
  60. package/lib/config/browserslistTargetHandler.js +19 -0
  61. package/lib/config/defaults.js +128 -43
  62. package/lib/config/normalization.js +2 -2
  63. package/lib/config/target.js +5 -0
  64. package/lib/container/ContainerEntryModule.js +6 -3
  65. package/lib/container/FallbackModule.js +6 -3
  66. package/lib/container/RemoteModule.js +1 -3
  67. package/lib/css/CssGenerator.js +26 -24
  68. package/lib/css/CssLoadingRuntimeModule.js +12 -4
  69. package/lib/css/CssModulesPlugin.js +29 -74
  70. package/lib/css/CssParser.js +828 -341
  71. package/lib/css/walkCssTokens.js +33 -13
  72. package/lib/dependencies/CachedConstDependency.js +24 -10
  73. package/lib/dependencies/CommonJsRequireContextDependency.js +1 -1
  74. package/lib/dependencies/ContextDependencyHelpers.js +2 -2
  75. package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +3 -1
  76. package/lib/dependencies/CssIcssExportDependency.js +242 -104
  77. package/lib/dependencies/CssIcssImportDependency.js +61 -4
  78. package/lib/dependencies/CssIcssSymbolDependency.js +2 -6
  79. package/lib/dependencies/CssImportDependency.js +2 -1
  80. package/lib/dependencies/CssUrlDependency.js +3 -2
  81. package/lib/dependencies/DynamicExports.js +7 -7
  82. package/lib/dependencies/ExternalModuleDependency.js +7 -4
  83. package/lib/dependencies/ExternalModuleInitFragment.js +2 -1
  84. package/lib/dependencies/ExternalModuleInitFragmentDependency.js +2 -1
  85. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +3 -2
  86. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +6 -4
  87. package/lib/dependencies/HarmonyExports.js +4 -4
  88. package/lib/dependencies/HarmonyImportDependency.js +8 -3
  89. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +1 -1
  90. package/lib/dependencies/ImportMetaPlugin.js +57 -0
  91. package/lib/dependencies/ImportParserPlugin.js +2 -2
  92. package/lib/dependencies/LocalModulesHelpers.js +3 -3
  93. package/lib/dependencies/WorkerPlugin.js +2 -2
  94. package/lib/dependencies/getFunctionExpression.js +1 -1
  95. package/lib/esm/ModuleChunkFormatPlugin.js +5 -4
  96. package/lib/hmr/HotModuleReplacement.runtime.js +2 -1
  97. package/lib/hmr/LazyCompilationPlugin.js +4 -3
  98. package/lib/ids/IdHelpers.js +16 -7
  99. package/lib/javascript/ChunkHelpers.js +1 -1
  100. package/lib/javascript/JavascriptGenerator.js +4 -3
  101. package/lib/javascript/JavascriptModulesPlugin.js +57 -24
  102. package/lib/javascript/JavascriptParser.js +19 -6
  103. package/lib/json/JsonGenerator.js +5 -4
  104. package/lib/json/JsonParser.js +2 -1
  105. package/lib/library/AbstractLibraryPlugin.js +1 -1
  106. package/lib/library/AmdLibraryPlugin.js +4 -1
  107. package/lib/library/ExportPropertyLibraryPlugin.js +4 -1
  108. package/lib/library/ModuleLibraryPlugin.js +41 -13
  109. package/lib/library/SystemLibraryPlugin.js +4 -1
  110. package/lib/library/UmdLibraryPlugin.js +1 -1
  111. package/lib/logging/Logger.js +5 -4
  112. package/lib/logging/createConsoleLogger.js +2 -2
  113. package/lib/optimize/ConcatenatedModule.js +47 -32
  114. package/lib/optimize/ModuleConcatenationPlugin.js +5 -4
  115. package/lib/optimize/SideEffectsFlagPlugin.js +3 -2
  116. package/lib/optimize/SplitChunksPlugin.js +60 -46
  117. package/lib/rules/RuleSetCompiler.js +1 -1
  118. package/lib/runtime/GetChunkFilenameRuntimeModule.js +3 -2
  119. package/lib/schemes/HttpUriPlugin.js +97 -10
  120. package/lib/serialization/AggregateErrorSerializer.js +1 -2
  121. package/lib/serialization/ObjectMiddleware.js +0 -2
  122. package/lib/serialization/SingleItemMiddleware.js +1 -1
  123. package/lib/sharing/ConsumeSharedModule.js +1 -1
  124. package/lib/sharing/ConsumeSharedPlugin.js +5 -3
  125. package/lib/sharing/ProvideSharedModule.js +1 -1
  126. package/lib/sharing/resolveMatchedConfigs.js +15 -9
  127. package/lib/sharing/utils.js +1 -1
  128. package/lib/stats/DefaultStatsFactoryPlugin.js +8 -5
  129. package/lib/stats/DefaultStatsPresetPlugin.js +1 -1
  130. package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
  131. package/lib/util/StringXor.js +1 -1
  132. package/lib/util/URLAbsoluteSpecifier.js +2 -2
  133. package/lib/util/binarySearchBounds.js +2 -2
  134. package/lib/util/comparators.js +53 -76
  135. package/lib/util/compileBooleanMatcher.js +78 -6
  136. package/lib/util/createHash.js +20 -199
  137. package/lib/util/deprecation.js +1 -1
  138. package/lib/util/deterministicGrouping.js +6 -3
  139. package/lib/util/fs.js +75 -75
  140. package/lib/util/hash/BatchedHash.js +10 -9
  141. package/lib/util/hash/BulkUpdateHash.js +138 -0
  142. package/lib/util/hash/DebugHash.js +75 -0
  143. package/lib/util/hash/hash-digest.js +216 -0
  144. package/lib/util/identifier.js +82 -17
  145. package/lib/util/internalSerializables.js +2 -6
  146. package/lib/util/runtime.js +3 -3
  147. package/lib/util/source.js +2 -2
  148. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +3 -2
  149. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +3 -2
  150. package/lib/wasm-sync/WebAssemblyGenerator.js +9 -6
  151. package/lib/wasm-sync/WebAssemblyJavascriptGenerator.js +3 -2
  152. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +6 -2
  153. package/lib/webpack.js +1 -1
  154. package/package.json +30 -25
  155. package/schemas/WebpackOptions.check.js +1 -1
  156. package/schemas/WebpackOptions.json +59 -82
  157. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +1 -1
  158. package/schemas/plugins/css/CssModuleParserOptions.check.js +1 -1
  159. package/types.d.ts +225 -158
  160. package/lib/ModuleSourceTypesConstants.js +0 -117
  161. package/lib/dependencies/CssIcssFromIdentifierDependency.js +0 -124
  162. package/lib/dependencies/CssIcssGlobalIdentifierDependency.js +0 -48
  163. package/lib/dependencies/CssIcssLocalIdentifierDependency.js +0 -61
  164. package/lib/dependencies/CssIcssSelfLocalIdentifierDependency.js +0 -190
  165. package/lib/util/jsonParseEvenBetterErrors.js +0 -10
  166. package/schemas/plugins/css/CssAutoGeneratorOptions.check.d.ts +0 -7
  167. package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +0 -6
  168. package/schemas/plugins/css/CssAutoGeneratorOptions.json +0 -3
  169. package/schemas/plugins/css/CssAutoParserOptions.check.d.ts +0 -7
  170. package/schemas/plugins/css/CssAutoParserOptions.check.js +0 -6
  171. package/schemas/plugins/css/CssAutoParserOptions.json +0 -3
  172. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.d.ts +0 -7
  173. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +0 -6
  174. package/schemas/plugins/css/CssGlobalGeneratorOptions.json +0 -3
  175. package/schemas/plugins/css/CssGlobalParserOptions.check.d.ts +0 -7
  176. package/schemas/plugins/css/CssGlobalParserOptions.check.js +0 -6
  177. package/schemas/plugins/css/CssGlobalParserOptions.json +0 -3
package/types.d.ts CHANGED
@@ -1048,7 +1048,7 @@ declare interface BufferedMap {
1048
1048
  type BuildInfo = KnownBuildInfo & Record<string, any>;
1049
1049
  type BuildMeta = KnownBuildMeta & Record<string, any>;
1050
1050
  declare abstract class ByTypeGenerator extends Generator {
1051
- map: Record<string, Generator>;
1051
+ map: { [index: string]: undefined | Generator };
1052
1052
  generateError?: (
1053
1053
  error: Error,
1054
1054
  module: NormalModule,
@@ -1372,7 +1372,7 @@ declare class ChunkGraph {
1372
1372
  setChunkModuleSourceTypes(
1373
1373
  chunk: Chunk,
1374
1374
  module: Module,
1375
- sourceTypes: Set<string>
1375
+ sourceTypes: ReadonlySet<string>
1376
1376
  ): void;
1377
1377
  getChunkModuleSourceTypes(chunk: Chunk, module: Module): ReadonlySet<string>;
1378
1378
  getModuleSourceTypes(module: Module): ReadonlySet<string>;
@@ -1945,6 +1945,11 @@ declare interface CodeGenerationContext {
1945
1945
  */
1946
1946
  runtime: RuntimeSpec;
1947
1947
 
1948
+ /**
1949
+ * all runtimes code should be generated for
1950
+ */
1951
+ runtimes: RuntimeSpec[];
1952
+
1948
1953
  /**
1949
1954
  * when in concatenated module, information about other concatenated modules
1950
1955
  */
@@ -3574,62 +3579,6 @@ type CreateWriteStreamFSImplementation = FSImplementation & {
3574
3579
  close?: (...args: any[]) => any;
3575
3580
  };
3576
3581
  declare interface CreatedObject<T, F> {}
3577
-
3578
- /**
3579
- * Generator options for css/auto modules.
3580
- */
3581
- declare interface CssAutoGeneratorOptions {
3582
- /**
3583
- * Configure the generated JS modules that use the ES modules syntax.
3584
- */
3585
- esModule?: boolean;
3586
-
3587
- /**
3588
- * Specifies the convention of exported names.
3589
- */
3590
- exportsConvention?:
3591
- | "as-is"
3592
- | "camel-case"
3593
- | "camel-case-only"
3594
- | "dashes"
3595
- | "dashes-only"
3596
- | ((name: string) => string);
3597
-
3598
- /**
3599
- * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
3600
- */
3601
- exportsOnly?: boolean;
3602
-
3603
- /**
3604
- * Configure the generated local ident name.
3605
- */
3606
- localIdentName?: string;
3607
- }
3608
-
3609
- /**
3610
- * Parser options for css/auto modules.
3611
- */
3612
- declare interface CssAutoParserOptions {
3613
- /**
3614
- * Configure how CSS content is exported as default.
3615
- */
3616
- exportType?: "link" | "text" | "css-style-sheet";
3617
-
3618
- /**
3619
- * Enable/disable `@import` at-rules handling.
3620
- */
3621
- import?: boolean;
3622
-
3623
- /**
3624
- * Use ES modules named export for css exports.
3625
- */
3626
- namedExports?: boolean;
3627
-
3628
- /**
3629
- * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
3630
- */
3631
- url?: boolean;
3632
- }
3633
3582
  declare interface CssData {
3634
3583
  /**
3635
3584
  * whether export __esModule
@@ -3642,14 +3591,7 @@ declare interface CssData {
3642
3591
  exports: Map<string, string>;
3643
3592
  }
3644
3593
  declare abstract class CssGenerator extends Generator {
3645
- convention?:
3646
- | "as-is"
3647
- | "camel-case"
3648
- | "camel-case-only"
3649
- | "dashes"
3650
- | "dashes-only"
3651
- | ((name: string) => string);
3652
- localIdentName?: string;
3594
+ options: CssModuleGeneratorOptions;
3653
3595
  sourceDependency(
3654
3596
  module: NormalModule,
3655
3597
  dependency: Dependency,
@@ -3684,67 +3626,6 @@ declare interface CssGeneratorOptions {
3684
3626
  */
3685
3627
  exportsOnly?: boolean;
3686
3628
  }
3687
-
3688
- /**
3689
- * Generator options for css/global modules.
3690
- */
3691
- declare interface CssGlobalGeneratorOptions {
3692
- /**
3693
- * Configure the generated JS modules that use the ES modules syntax.
3694
- */
3695
- esModule?: boolean;
3696
-
3697
- /**
3698
- * Configure how CSS content is exported as default.
3699
- */
3700
- exportType?: "link" | "text" | "css-style-sheet";
3701
-
3702
- /**
3703
- * Specifies the convention of exported names.
3704
- */
3705
- exportsConvention?:
3706
- | "as-is"
3707
- | "camel-case"
3708
- | "camel-case-only"
3709
- | "dashes"
3710
- | "dashes-only"
3711
- | ((name: string) => string);
3712
-
3713
- /**
3714
- * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
3715
- */
3716
- exportsOnly?: boolean;
3717
-
3718
- /**
3719
- * Configure the generated local ident name.
3720
- */
3721
- localIdentName?: string;
3722
- }
3723
-
3724
- /**
3725
- * Parser options for css/global modules.
3726
- */
3727
- declare interface CssGlobalParserOptions {
3728
- /**
3729
- * Configure how CSS content is exported as default.
3730
- */
3731
- exportType?: "link" | "text" | "css-style-sheet";
3732
-
3733
- /**
3734
- * Enable/disable `@import` at-rules handling.
3735
- */
3736
- import?: boolean;
3737
-
3738
- /**
3739
- * Use ES modules named export for css exports.
3740
- */
3741
- namedExports?: boolean;
3742
-
3743
- /**
3744
- * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
3745
- */
3746
- url?: boolean;
3747
- }
3748
3629
  declare interface CssImportDependencyMeta {
3749
3630
  layer?: string;
3750
3631
  supports?: string;
@@ -3819,6 +3700,21 @@ declare interface CssModuleGeneratorOptions {
3819
3700
  */
3820
3701
  exportsOnly?: boolean;
3821
3702
 
3703
+ /**
3704
+ * Digest types used for the hash.
3705
+ */
3706
+ localIdentHashDigest?: string;
3707
+
3708
+ /**
3709
+ * Number of chars which are used for the hash.
3710
+ */
3711
+ localIdentHashDigestLength?: number;
3712
+
3713
+ /**
3714
+ * Any string which is added to the hash to salt it.
3715
+ */
3716
+ localIdentHashSalt?: string;
3717
+
3822
3718
  /**
3823
3719
  * Configure the generated local ident name.
3824
3720
  */
@@ -3829,11 +3725,41 @@ declare interface CssModuleGeneratorOptions {
3829
3725
  * Parser options for css/module modules.
3830
3726
  */
3831
3727
  declare interface CssModuleParserOptions {
3728
+ /**
3729
+ * Enable/disable renaming of `@keyframes`.
3730
+ */
3731
+ animation?: boolean;
3732
+
3733
+ /**
3734
+ * Enable/disable renaming of `@container` names.
3735
+ */
3736
+ container?: boolean;
3737
+
3738
+ /**
3739
+ * Enable/disable renaming of custom identifiers.
3740
+ */
3741
+ customIdents?: boolean;
3742
+
3743
+ /**
3744
+ * Enable/disable renaming of dashed identifiers, e. g. custom properties.
3745
+ */
3746
+ dashedIdents?: boolean;
3747
+
3832
3748
  /**
3833
3749
  * Configure how CSS content is exported as default.
3834
3750
  */
3835
3751
  exportType?: "link" | "text" | "css-style-sheet";
3836
3752
 
3753
+ /**
3754
+ * Enable/disable renaming of `@function` names.
3755
+ */
3756
+ function?: boolean;
3757
+
3758
+ /**
3759
+ * Enable/disable renaming of grid identifiers.
3760
+ */
3761
+ grid?: boolean;
3762
+
3837
3763
  /**
3838
3764
  * Enable/disable `@import` at-rules handling.
3839
3765
  */
@@ -3886,10 +3812,52 @@ declare class CssModulesPlugin {
3886
3812
  }
3887
3813
  declare abstract class CssParser extends ParserClass {
3888
3814
  defaultMode: "global" | "auto" | "pure" | "local";
3889
- import: boolean;
3890
- url: boolean;
3891
- namedExports: boolean;
3892
- exportType?: "link" | "text" | "css-style-sheet";
3815
+ options: {
3816
+ /**
3817
+ * Enable/disable renaming of `@keyframes`.
3818
+ */
3819
+ animation: boolean;
3820
+ /**
3821
+ * Enable/disable renaming of `@container` names.
3822
+ */
3823
+ container: boolean;
3824
+ /**
3825
+ * Enable/disable renaming of custom identifiers.
3826
+ */
3827
+ customIdents: boolean;
3828
+ /**
3829
+ * Enable/disable renaming of dashed identifiers, e. g. custom properties.
3830
+ */
3831
+ dashedIdents: boolean;
3832
+ /**
3833
+ * Configure how CSS content is exported as default.
3834
+ */
3835
+ exportType?: "link" | "text" | "css-style-sheet";
3836
+ /**
3837
+ * Enable/disable renaming of `@function` names.
3838
+ */
3839
+ function: boolean;
3840
+ /**
3841
+ * Enable/disable renaming of grid identifiers.
3842
+ */
3843
+ grid: boolean;
3844
+ /**
3845
+ * Enable/disable `@import` at-rules handling.
3846
+ */
3847
+ import: boolean;
3848
+ /**
3849
+ * Use ES modules named export for css exports.
3850
+ */
3851
+ namedExports: boolean;
3852
+ /**
3853
+ * Enable/disable `url()`/`image-set()`/`src()`/`image()` functions handling.
3854
+ */
3855
+ url: boolean;
3856
+ /**
3857
+ * default mode
3858
+ */
3859
+ defaultMode?: "global" | "auto" | "pure" | "local";
3860
+ };
3893
3861
  comments?: CommentCssParser[];
3894
3862
  magicCommentContext: Context;
3895
3863
  getComments(range: [number, number]): CommentCssParser[];
@@ -3935,6 +3903,7 @@ declare class DefinePlugin {
3935
3903
  * Apply the plugin
3936
3904
  */
3937
3905
  apply(compiler: Compiler): void;
3906
+ static getCompilationHooks(compilation: Compilation): DefinePluginHooks;
3938
3907
  static runtimeValue(
3939
3908
  fn: (value: {
3940
3909
  module: NormalModule;
@@ -3944,6 +3913,12 @@ declare class DefinePlugin {
3944
3913
  options?: true | string[] | RuntimeValueOptions
3945
3914
  ): RuntimeValue;
3946
3915
  }
3916
+ declare interface DefinePluginHooks {
3917
+ definitions: SyncWaterfallHook<
3918
+ [Record<string, CodeValue>],
3919
+ Record<string, CodeValue>
3920
+ >;
3921
+ }
3947
3922
  declare class DelegatedPlugin {
3948
3923
  constructor(options: Options);
3949
3924
  options: Options;
@@ -4929,6 +4904,11 @@ declare interface Environment {
4929
4904
  */
4930
4905
  importMetaDirnameAndFilename?: boolean;
4931
4906
 
4907
+ /**
4908
+ * The environment supports object method shorthand ('{ module() {} }').
4909
+ */
4910
+ methodShorthand?: boolean;
4911
+
4932
4912
  /**
4933
4913
  * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
4934
4914
  */
@@ -5255,6 +5235,27 @@ declare abstract class ExportInfo {
5255
5235
  | "not provided";
5256
5236
  getRenameInfo(): string;
5257
5237
  }
5238
+ declare abstract class ExportMode {
5239
+ type: ExportModeType;
5240
+ items: null | NormalReexportItem[];
5241
+ name: null | string;
5242
+ partialNamespaceExportInfo: null | ExportInfo;
5243
+ ignored: null | Set<string>;
5244
+ hidden?: null | Set<string>;
5245
+ userRequest: null | string;
5246
+ fakeType: number;
5247
+ }
5248
+ type ExportModeType =
5249
+ | "unused"
5250
+ | "missing"
5251
+ | "empty-star"
5252
+ | "reexport-dynamic-default"
5253
+ | "reexport-named-default"
5254
+ | "reexport-namespace-object"
5255
+ | "reexport-fake-namespace-object"
5256
+ | "reexport-undefined"
5257
+ | "normal-reexport"
5258
+ | "dynamic-reexport";
5258
5259
  type ExportPresenceMode = false | 0 | 1 | 2 | 3;
5259
5260
  declare interface ExportSpec {
5260
5261
  /**
@@ -6100,7 +6101,9 @@ declare class Generator {
6100
6101
  context: ConcatenationBailoutReasonContext
6101
6102
  ): undefined | string;
6102
6103
  updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
6103
- static byType(map: Record<string, Generator>): ByTypeGenerator;
6104
+ static byType(map: {
6105
+ [index: string]: undefined | Generator;
6106
+ }): ByTypeGenerator;
6104
6107
  }
6105
6108
  declare interface GeneratorOptions {
6106
6109
  [index: string]: any;
@@ -6143,14 +6146,14 @@ declare interface GeneratorOptionsByModuleTypeKnown {
6143
6146
  css?: CssGeneratorOptions;
6144
6147
 
6145
6148
  /**
6146
- * Generator options for css/auto modules.
6149
+ * Generator options for css/module modules.
6147
6150
  */
6148
- "css/auto"?: CssAutoGeneratorOptions;
6151
+ "css/auto"?: CssModuleGeneratorOptions;
6149
6152
 
6150
6153
  /**
6151
- * Generator options for css/global modules.
6154
+ * Generator options for css/module modules.
6152
6155
  */
6153
- "css/global"?: CssGlobalGeneratorOptions;
6156
+ "css/global"?: CssModuleGeneratorOptions;
6154
6157
 
6155
6158
  /**
6156
6159
  * Generator options for css/module modules.
@@ -6303,11 +6306,36 @@ declare interface HandleModuleCreationOptions {
6303
6306
  */
6304
6307
  checkCycle?: boolean;
6305
6308
  }
6309
+ declare abstract class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
6310
+ ids: string[];
6311
+ name: null | string;
6312
+ activeExports: Set<string>;
6313
+ otherStarExports: null | ReadonlyArray<HarmonyExportImportedSpecifierDependency>;
6314
+ exportPresenceMode: ExportPresenceMode;
6315
+ allStarExports: null | HarmonyStarExportsList;
6316
+ get id(): void;
6317
+ getId(): void;
6318
+ setId(): void;
6319
+ getIds(moduleGraph: ModuleGraph): string[];
6320
+ setIds(moduleGraph: ModuleGraph, ids: string[]): void;
6321
+ getMode(moduleGraph: ModuleGraph, runtime: RuntimeSpec): ExportMode;
6322
+ getStarReexports(
6323
+ moduleGraph: ModuleGraph,
6324
+ runtime: RuntimeSpec,
6325
+ exportsInfo?: ExportsInfo,
6326
+ importedModule?: Module
6327
+ ): {
6328
+ exports?: Set<string>;
6329
+ checked?: Set<string>;
6330
+ ignoredExports: Set<string>;
6331
+ hidden?: Set<string>;
6332
+ };
6333
+ }
6306
6334
  declare class HarmonyImportDependency extends ModuleDependency {
6307
6335
  constructor(
6308
6336
  request: string,
6309
6337
  sourceOrder: number,
6310
- phase: ImportPhaseType,
6338
+ phase?: 0 | 1 | 2,
6311
6339
  attributes?: ImportAttributes
6312
6340
  );
6313
6341
  phase: ImportPhaseType;
@@ -6352,6 +6380,13 @@ declare interface HarmonySettings {
6352
6380
  attributes?: ImportAttributes;
6353
6381
  phase: ImportPhaseType;
6354
6382
  }
6383
+ declare abstract class HarmonyStarExportsList {
6384
+ dependencies: HarmonyExportImportedSpecifierDependency[];
6385
+ push(dep: HarmonyExportImportedSpecifierDependency): void;
6386
+ slice(): HarmonyExportImportedSpecifierDependency[];
6387
+ serialize(__0: ObjectSerializerContext): void;
6388
+ deserialize(__0: ObjectDeserializerContext): void;
6389
+ }
6355
6390
  declare class Hash {
6356
6391
  constructor();
6357
6392
 
@@ -6810,8 +6845,7 @@ declare abstract class ItemCacheFacade {
6810
6845
  providePromise<T>(computer: () => T | Promise<T>): Promise<T>;
6811
6846
  }
6812
6847
  declare interface IteratorObject<T, TReturn = unknown, TNext = unknown>
6813
- extends Iterator<T, TReturn, TNext>,
6814
- Disposable {
6848
+ extends Iterator<T, TReturn, TNext>, Disposable {
6815
6849
  [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
6816
6850
  [Symbol.dispose](): void;
6817
6851
  }
@@ -7328,7 +7362,7 @@ declare class JavascriptParser extends ParserClass {
7328
7362
  sourceType: "module" | "auto" | "script";
7329
7363
  options: { parse?: (code: string, options: ParseOptions) => ParseResult };
7330
7364
  scope: ScopeInfo;
7331
- state: ParserState;
7365
+ state: JavascriptParserState;
7332
7366
  comments?: CommentJavascriptParser[];
7333
7367
  semicolons?: Set<number>;
7334
7368
  statementPath?: StatementPathItem[];
@@ -8533,6 +8567,9 @@ declare interface JavascriptParserOptions {
8533
8567
  */
8534
8568
  wrappedContextRegExp?: RegExp;
8535
8569
  }
8570
+ type JavascriptParserState = ParserStateBase &
8571
+ Record<string, any> &
8572
+ KnownJavascriptParserState;
8536
8573
  declare abstract class JsonData {
8537
8574
  get():
8538
8575
  | undefined
@@ -8874,8 +8911,8 @@ declare interface KnownBuildMeta {
8874
8911
  sideEffectFree?: boolean;
8875
8912
  isCSSModule?: boolean;
8876
8913
  jsIncompatibleExports?: Record<string, string>;
8877
- exportsFinalName?: Record<string, string>;
8878
- factoryExportsBinding?: string;
8914
+ exportsFinalNameByRuntime?: Map<RuntimeSpec, Record<string, string>>;
8915
+ exportsSourceByRuntime?: Map<RuntimeSpec, string>;
8879
8916
  }
8880
8917
  declare interface KnownCreateStatsOptionsContext {
8881
8918
  forToString?: boolean;
@@ -8912,6 +8949,12 @@ declare interface KnownHooks {
8912
8949
  */
8913
8950
  result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>;
8914
8951
  }
8952
+ declare interface KnownJavascriptParserState {
8953
+ harmonyNamedExports?: Set<string>;
8954
+ harmonyStarExports?: HarmonyStarExportsList;
8955
+ lastHarmonyImportOrder?: number;
8956
+ localModules?: LocalModule[];
8957
+ }
8915
8958
  declare interface KnownMeta {
8916
8959
  importVarMap?: Map<Module, string>;
8917
8960
  deferredImportVarMap?: Map<Module, string>;
@@ -9876,6 +9919,15 @@ declare class LoaderTargetPlugin {
9876
9919
  */
9877
9920
  apply(compiler: Compiler): void;
9878
9921
  }
9922
+ declare abstract class LocalModule {
9923
+ name: string;
9924
+ idx: number;
9925
+ used: boolean;
9926
+ flagUsed(): void;
9927
+ variableName(): string;
9928
+ serialize(context: ObjectSerializerContext): void;
9929
+ deserialize(context: ObjectDeserializerContext): void;
9930
+ }
9879
9931
  declare interface LogEntry {
9880
9932
  type: string;
9881
9933
  args?: any[];
@@ -10724,6 +10776,7 @@ declare class ModuleGraph {
10724
10776
  connection?: ModuleGraphConnection,
10725
10777
  parentModule?: Module
10726
10778
  ): void;
10779
+ finishUpdateParent(): void;
10727
10780
  removeConnection(dependency: Dependency): void;
10728
10781
  addExplanation(dependency: Dependency, explanation: string): void;
10729
10782
  cloneModuleAttributes(sourceModule: Module, targetModule: Module): void;
@@ -11141,6 +11194,11 @@ declare interface ModuleRenderContext {
11141
11194
  * the inlined entry module is wrapped in an IIFE, existing only when `factory` is set to false
11142
11195
  */
11143
11196
  inlinedInIIFE?: boolean;
11197
+
11198
+ /**
11199
+ * render module in object container
11200
+ */
11201
+ renderInObject?: boolean;
11144
11202
  }
11145
11203
  declare interface ModuleResult {
11146
11204
  client: string;
@@ -11692,14 +11750,14 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11692
11750
  SyncBailHook<[EmptyParserOptions], WebAssemblyParser>
11693
11751
  > &
11694
11752
  Record<"css", SyncBailHook<[CssParserOptions], CssParser>> &
11695
- Record<"css/auto", SyncBailHook<[CssAutoParserOptions], CssParser>> &
11753
+ Record<"css/auto", SyncBailHook<[CssModuleParserOptions], CssParser>> &
11696
11754
  Record<
11697
11755
  "css/module",
11698
11756
  SyncBailHook<[CssModuleParserOptions], CssParser>
11699
11757
  > &
11700
11758
  Record<
11701
11759
  "css/global",
11702
- SyncBailHook<[CssGlobalParserOptions], CssParser>
11760
+ SyncBailHook<[CssModuleParserOptions], CssParser>
11703
11761
  > &
11704
11762
  Record<string, SyncBailHook<[ParserOptions], ParserClass>>
11705
11763
  >;
@@ -11745,7 +11803,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11745
11803
  Record<"css", SyncBailHook<[CssParser, CssParserOptions], void>> &
11746
11804
  Record<
11747
11805
  "css/auto",
11748
- SyncBailHook<[CssParser, CssAutoParserOptions], void>
11806
+ SyncBailHook<[CssParser, CssModuleParserOptions], void>
11749
11807
  > &
11750
11808
  Record<
11751
11809
  "css/module",
@@ -11753,7 +11811,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11753
11811
  > &
11754
11812
  Record<
11755
11813
  "css/global",
11756
- SyncBailHook<[CssParser, CssGlobalParserOptions], void>
11814
+ SyncBailHook<[CssParser, CssModuleParserOptions], void>
11757
11815
  > &
11758
11816
  Record<string, SyncBailHook<[ParserClass, ParserOptions], void>>
11759
11817
  >;
@@ -11799,7 +11857,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11799
11857
  Record<"css", SyncBailHook<[CssGeneratorOptions], CssGenerator>> &
11800
11858
  Record<
11801
11859
  "css/auto",
11802
- SyncBailHook<[CssAutoGeneratorOptions], CssGenerator>
11860
+ SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
11803
11861
  > &
11804
11862
  Record<
11805
11863
  "css/module",
@@ -11807,7 +11865,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11807
11865
  > &
11808
11866
  Record<
11809
11867
  "css/global",
11810
- SyncBailHook<[CssGlobalGeneratorOptions], CssGenerator>
11868
+ SyncBailHook<[CssModuleGeneratorOptions], CssGenerator>
11811
11869
  > &
11812
11870
  Record<string, SyncBailHook<[GeneratorOptions], Generator>>
11813
11871
  >;
@@ -11859,7 +11917,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11859
11917
  Record<"css", SyncBailHook<[CssGenerator, CssGeneratorOptions], void>> &
11860
11918
  Record<
11861
11919
  "css/auto",
11862
- SyncBailHook<[CssGenerator, CssAutoGeneratorOptions], void>
11920
+ SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
11863
11921
  > &
11864
11922
  Record<
11865
11923
  "css/module",
@@ -11867,7 +11925,7 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
11867
11925
  > &
11868
11926
  Record<
11869
11927
  "css/global",
11870
- SyncBailHook<[CssGenerator, CssGlobalGeneratorOptions], void>
11928
+ SyncBailHook<[CssGenerator, CssModuleGeneratorOptions], void>
11871
11929
  > &
11872
11930
  Record<string, SyncBailHook<[Generator, GeneratorOptions], void>>
11873
11931
  >;
@@ -11990,6 +12048,13 @@ declare class NormalModuleReplacementPlugin {
11990
12048
  */
11991
12049
  apply(compiler: Compiler): void;
11992
12050
  }
12051
+ declare abstract class NormalReexportItem {
12052
+ name: string;
12053
+ ids: string[];
12054
+ exportInfo: ExportInfo;
12055
+ checked: boolean;
12056
+ hidden: boolean;
12057
+ }
11993
12058
  type NormalizedStatsOptions = KnownNormalizedStatsOptions &
11994
12059
  Omit<
11995
12060
  StatsOptions,
@@ -13607,14 +13672,14 @@ declare interface ParserOptionsByModuleTypeKnown {
13607
13672
  css?: CssParserOptions;
13608
13673
 
13609
13674
  /**
13610
- * Parser options for css/auto modules.
13675
+ * Parser options for css/module modules.
13611
13676
  */
13612
- "css/auto"?: CssAutoParserOptions;
13677
+ "css/auto"?: CssModuleParserOptions;
13613
13678
 
13614
13679
  /**
13615
- * Parser options for css/global modules.
13680
+ * Parser options for css/module modules.
13616
13681
  */
13617
- "css/global"?: CssGlobalParserOptions;
13682
+ "css/global"?: CssModuleParserOptions;
13618
13683
 
13619
13684
  /**
13620
13685
  * Parser options for css/module modules.
@@ -13653,7 +13718,7 @@ declare interface ParserOptionsByModuleTypeKnown {
13653
13718
  declare interface ParserOptionsByModuleTypeUnknown {
13654
13719
  [index: string]: { [index: string]: any };
13655
13720
  }
13656
- type ParserState = Record<string, any> & ParserStateBase;
13721
+ type ParserState = ParserStateBase & Record<string, any>;
13657
13722
  declare interface ParserStateBase {
13658
13723
  source: string | Buffer;
13659
13724
  current: NormalModule;
@@ -13676,6 +13741,7 @@ declare interface PathData {
13676
13741
  contentHashWithLength?: (length: number) => string;
13677
13742
  noChunkHash?: boolean;
13678
13743
  url?: string;
13744
+ prepareId?: (id: string | number) => string | number;
13679
13745
  }
13680
13746
  type PathLikeFs = string | Buffer | URL;
13681
13747
  type PathLikeTypes = string | URL_url | Buffer;
@@ -16222,6 +16288,7 @@ declare abstract class RuntimeTemplate {
16222
16288
  isModule(): boolean;
16223
16289
  isNeutralPlatform(): boolean;
16224
16290
  supportsConst(): boolean;
16291
+ supportsMethodShorthand(): boolean;
16225
16292
  supportsArrowFunction(): boolean;
16226
16293
  supportsAsyncFunction(): boolean;
16227
16294
  supportsOptionalChaining(): boolean;
@@ -18166,7 +18233,7 @@ declare class Template {
18166
18233
  static renderChunkModules(
18167
18234
  renderContext: ChunkRenderContextJavascriptModulesPlugin,
18168
18235
  modules: Module[],
18169
- renderModule: (module: Module) => null | Source,
18236
+ renderModule: (module: Module, renderInArray?: boolean) => null | Source,
18170
18237
  prefix?: string
18171
18238
  ): null | Source;
18172
18239
  static renderRuntimeModules(
@@ -18502,7 +18569,6 @@ declare class WebpackError extends Error {
18502
18569
  file?: string;
18503
18570
  serialize(__0: ObjectSerializerContext): void;
18504
18571
  deserialize(__0: ObjectDeserializerContext): void;
18505
- cause: any;
18506
18572
 
18507
18573
  /**
18508
18574
  * Creates a `.stack` property on `targetObject`, which when accessed returns
@@ -19363,7 +19429,8 @@ declare namespace exports {
19363
19429
  export let keepOriginalOrder: <T>(iterable: Iterable<T>) => Comparator<T>;
19364
19430
  export let sortWithSourceOrder: (
19365
19431
  dependencies: Dependency[],
19366
- dependencySourceOrderMap: WeakMap<Dependency, DependencySourceOrder>
19432
+ dependencySourceOrderMap: WeakMap<Dependency, DependencySourceOrder>,
19433
+ onDependencyReSort?: (dep: Dependency, index: number) => void
19367
19434
  ) => void;
19368
19435
  }
19369
19436
  export namespace runtime {