webpack 5.65.0 → 5.68.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 (117) hide show
  1. package/README.md +1 -1
  2. package/lib/APIPlugin.js +33 -0
  3. package/lib/Cache.js +1 -1
  4. package/lib/CacheFacade.js +4 -11
  5. package/lib/Chunk.js +2 -0
  6. package/lib/CleanPlugin.js +1 -1
  7. package/lib/Compilation.js +91 -47
  8. package/lib/Compiler.js +57 -3
  9. package/lib/ContextModule.js +21 -17
  10. package/lib/DelegatedModule.js +1 -1
  11. package/lib/Dependency.js +10 -0
  12. package/lib/DependencyTemplate.js +9 -0
  13. package/lib/DependencyTemplates.js +1 -1
  14. package/lib/DllModule.js +1 -1
  15. package/lib/EvalDevToolModulePlugin.js +16 -1
  16. package/lib/EvalSourceMapDevToolPlugin.js +18 -1
  17. package/lib/ExternalModule.js +93 -53
  18. package/lib/ExternalModuleFactoryPlugin.js +1 -1
  19. package/lib/FileSystemInfo.js +29 -25
  20. package/lib/Generator.js +2 -0
  21. package/lib/HookWebpackError.js +1 -1
  22. package/lib/Module.js +25 -4
  23. package/lib/ModuleFilenameHelpers.js +5 -1
  24. package/lib/MultiCompiler.js +1 -1
  25. package/lib/MultiWatching.js +1 -1
  26. package/lib/NormalModule.js +9 -5
  27. package/lib/RawModule.js +1 -1
  28. package/lib/RuntimeGlobals.js +29 -1
  29. package/lib/RuntimeModule.js +1 -1
  30. package/lib/RuntimePlugin.js +50 -0
  31. package/lib/RuntimeTemplate.js +21 -0
  32. package/lib/Template.js +2 -1
  33. package/lib/Watching.js +2 -2
  34. package/lib/WebpackOptionsApply.js +43 -2
  35. package/lib/asset/AssetGenerator.js +64 -24
  36. package/lib/asset/AssetModulesPlugin.js +3 -0
  37. package/lib/asset/RawDataUrlModule.js +148 -0
  38. package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -4
  39. package/lib/cache/ResolverCachePlugin.js +1 -1
  40. package/lib/cli.js +44 -3
  41. package/lib/config/defaults.js +79 -5
  42. package/lib/config/normalization.js +5 -0
  43. package/lib/container/ContainerEntryModule.js +4 -2
  44. package/lib/container/FallbackModule.js +4 -4
  45. package/lib/container/RemoteModule.js +4 -2
  46. package/lib/css/CssExportsGenerator.js +139 -0
  47. package/lib/css/CssGenerator.js +109 -0
  48. package/lib/css/CssLoadingRuntimeModule.js +447 -0
  49. package/lib/css/CssModulesPlugin.js +461 -0
  50. package/lib/css/CssParser.js +618 -0
  51. package/lib/css/walkCssTokens.js +659 -0
  52. package/lib/debug/ProfilingPlugin.js +12 -10
  53. package/lib/dependencies/CreateScriptUrlDependency.js +12 -0
  54. package/lib/dependencies/CssExportDependency.js +85 -0
  55. package/lib/dependencies/CssImportDependency.js +75 -0
  56. package/lib/dependencies/CssLocalIdentifierDependency.js +119 -0
  57. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +101 -0
  58. package/lib/dependencies/CssUrlDependency.js +132 -0
  59. package/lib/dependencies/HarmonyCompatibilityDependency.js +5 -5
  60. package/lib/dependencies/ImportMetaPlugin.js +22 -3
  61. package/lib/dependencies/LoaderPlugin.js +2 -2
  62. package/lib/dependencies/URLDependency.js +3 -8
  63. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +1 -1
  64. package/lib/hmr/LazyCompilationPlugin.js +45 -21
  65. package/lib/hmr/lazyCompilationBackend.js +4 -2
  66. package/lib/ids/DeterministicModuleIdsPlugin.js +55 -35
  67. package/lib/ids/HashedModuleIdsPlugin.js +9 -12
  68. package/lib/ids/IdHelpers.js +24 -10
  69. package/lib/ids/NamedModuleIdsPlugin.js +6 -9
  70. package/lib/ids/NaturalModuleIdsPlugin.js +10 -13
  71. package/lib/ids/OccurrenceModuleIdsPlugin.js +13 -10
  72. package/lib/ids/SyncModuleIdsPlugin.js +140 -0
  73. package/lib/index.js +5 -0
  74. package/lib/javascript/JavascriptGenerator.js +1 -0
  75. package/lib/javascript/StartupHelpers.js +3 -3
  76. package/lib/library/AssignLibraryPlugin.js +26 -3
  77. package/lib/library/EnableLibraryPlugin.js +11 -0
  78. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +1 -1
  79. package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -1
  80. package/lib/optimize/ConcatenatedModule.js +11 -5
  81. package/lib/runtime/AsyncModuleRuntimeModule.js +25 -15
  82. package/lib/runtime/CreateScriptRuntimeModule.js +36 -0
  83. package/lib/runtime/CreateScriptUrlRuntimeModule.js +9 -34
  84. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +76 -0
  85. package/lib/schemes/HttpUriPlugin.js +8 -8
  86. package/lib/sharing/ConsumeSharedModule.js +4 -2
  87. package/lib/sharing/ProvideSharedModule.js +4 -2
  88. package/lib/sharing/utils.js +1 -1
  89. package/lib/stats/DefaultStatsFactoryPlugin.js +112 -67
  90. package/lib/stats/DefaultStatsPrinterPlugin.js +88 -23
  91. package/lib/util/ArrayHelpers.js +18 -4
  92. package/lib/util/AsyncQueue.js +1 -1
  93. package/lib/util/hash/xxhash64.js +2 -2
  94. package/lib/util/internalSerializables.js +11 -0
  95. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +9 -3
  96. package/lib/web/JsonpChunkLoadingRuntimeModule.js +2 -2
  97. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -11
  98. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +1 -1
  99. package/package.json +4 -11
  100. package/schemas/WebpackOptions.check.js +1 -1
  101. package/schemas/WebpackOptions.json +96 -1
  102. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
  103. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
  104. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  105. package/schemas/plugins/container/ContainerPlugin.json +2 -1
  106. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  107. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  108. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  109. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  110. package/schemas/plugins/container/ModuleFederationPlugin.json +3 -1
  111. package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +7 -0
  112. package/schemas/plugins/css/CssGeneratorOptions.check.js +6 -0
  113. package/schemas/plugins/css/CssGeneratorOptions.json +3 -0
  114. package/schemas/plugins/css/CssParserOptions.check.d.ts +7 -0
  115. package/schemas/plugins/css/CssParserOptions.check.js +6 -0
  116. package/schemas/plugins/css/CssParserOptions.json +3 -0
  117. package/types.d.ts +249 -39
package/types.d.ts CHANGED
@@ -215,6 +215,7 @@ declare interface Argument {
215
215
  }
216
216
  declare interface ArgumentConfig {
217
217
  description: string;
218
+ negatedDescription?: string;
218
219
  path: string;
219
220
  multiple: boolean;
220
221
  type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
@@ -320,6 +321,11 @@ declare interface AssetResourceGeneratorOptions {
320
321
  */
321
322
  filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
322
323
 
324
+ /**
325
+ * Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
326
+ */
327
+ outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
328
+
323
329
  /**
324
330
  * The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
325
331
  */
@@ -675,16 +681,16 @@ declare interface CallExpressionInfo {
675
681
  getMembers: () => string[];
676
682
  }
677
683
  declare interface CallbackAsyncQueue<T> {
678
- (err?: WebpackError, result?: T): any;
684
+ (err?: null | WebpackError, result?: T): any;
679
685
  }
680
686
  declare interface CallbackCache<T> {
681
- (err?: WebpackError, result?: T): void;
687
+ (err?: null | WebpackError, result?: T): void;
682
688
  }
683
689
  declare interface CallbackFunction<T> {
684
- (err?: Error, result?: T): any;
690
+ (err?: null | Error, result?: T): any;
685
691
  }
686
692
  declare interface CallbackNormalErrorCache<T> {
687
- (err?: Error, result?: T): void;
693
+ (err?: null | Error, result?: T): void;
688
694
  }
689
695
  declare interface CallbackWebpack<T> {
690
696
  (err?: Error, stats?: T): void;
@@ -702,6 +708,10 @@ declare class Chunk {
702
708
  | null
703
709
  | string
704
710
  | ((arg0: PathData, arg1?: AssetInfo) => string);
711
+ cssFilenameTemplate:
712
+ | null
713
+ | string
714
+ | ((arg0: PathData, arg1?: AssetInfo) => string);
705
715
  runtime: RuntimeSpec;
706
716
  files: Set<string>;
707
717
  auxiliaryFiles: Set<string>;
@@ -1217,6 +1227,11 @@ declare interface CodeGenerationContext {
1217
1227
  * when in concatenated module, information about other concatenated modules
1218
1228
  */
1219
1229
  concatenationScope?: ConcatenationScope;
1230
+
1231
+ /**
1232
+ * code generation results of other modules (need to have a codeGenerationDependency to use that)
1233
+ */
1234
+ codeGenerationResults: CodeGenerationResults;
1220
1235
  }
1221
1236
  declare interface CodeGenerationResult {
1222
1237
  /**
@@ -1532,7 +1547,7 @@ declare class Compilation {
1532
1547
  getLogger(name: string | (() => string)): WebpackLogger;
1533
1548
  addModule(
1534
1549
  module: Module,
1535
- callback: (err?: WebpackError, result?: Module) => void
1550
+ callback: (err?: null | WebpackError, result?: Module) => void
1536
1551
  ): void;
1537
1552
 
1538
1553
  /**
@@ -1550,21 +1565,21 @@ declare class Compilation {
1550
1565
  */
1551
1566
  buildModule(
1552
1567
  module: Module,
1553
- callback: (err?: WebpackError, result?: Module) => void
1568
+ callback: (err?: null | WebpackError, result?: Module) => void
1554
1569
  ): void;
1555
1570
  processModuleDependencies(
1556
1571
  module: Module,
1557
- callback: (err?: WebpackError, result?: Module) => void
1572
+ callback: (err?: null | WebpackError, result?: Module) => void
1558
1573
  ): void;
1559
1574
  processModuleDependenciesNonRecursive(module: Module): void;
1560
1575
  handleModuleCreation(
1561
1576
  __0: HandleModuleCreationOptions,
1562
- callback: (err?: WebpackError, result?: Module) => void
1577
+ callback: (err?: null | WebpackError, result?: Module) => void
1563
1578
  ): void;
1564
1579
  addModuleChain(
1565
1580
  context: string,
1566
1581
  dependency: Dependency,
1567
- callback: (err?: WebpackError, result?: Module) => void
1582
+ callback: (err?: null | WebpackError, result?: Module) => void
1568
1583
  ): void;
1569
1584
  addModuleTree(
1570
1585
  __0: {
@@ -1581,27 +1596,27 @@ declare class Compilation {
1581
1596
  */
1582
1597
  contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
1583
1598
  },
1584
- callback: (err?: WebpackError, result?: Module) => void
1599
+ callback: (err?: null | WebpackError, result?: Module) => void
1585
1600
  ): void;
1586
1601
  addEntry(
1587
1602
  context: string,
1588
1603
  entry: Dependency,
1589
1604
  optionsOrName: string | EntryOptions,
1590
- callback: (err?: WebpackError, result?: Module) => void
1605
+ callback: (err?: null | WebpackError, result?: Module) => void
1591
1606
  ): void;
1592
1607
  addInclude(
1593
1608
  context: string,
1594
1609
  dependency: Dependency,
1595
1610
  options: EntryOptions,
1596
- callback: (err?: WebpackError, result?: Module) => void
1611
+ callback: (err?: null | WebpackError, result?: Module) => void
1597
1612
  ): void;
1598
1613
  rebuildModule(
1599
1614
  module: Module,
1600
- callback: (err?: WebpackError, result?: Module) => void
1615
+ callback: (err?: null | WebpackError, result?: Module) => void
1601
1616
  ): void;
1602
1617
  finish(callback?: any): void;
1603
1618
  unseal(): void;
1604
- seal(callback: (err?: WebpackError) => void): void;
1619
+ seal(callback: (err?: null | WebpackError) => void): void;
1605
1620
  reportDependencyErrorsAndWarnings(
1606
1621
  module: Module,
1607
1622
  blocks: DependenciesBlock[]
@@ -1634,11 +1649,15 @@ declare class Compilation {
1634
1649
  module: RuntimeModule,
1635
1650
  chunkGraph?: ChunkGraph
1636
1651
  ): void;
1652
+
1653
+ /**
1654
+ * If `module` is passed, `loc` and `request` must also be passed.
1655
+ */
1637
1656
  addChunkInGroup(
1638
1657
  groupOptions: string | ChunkGroupOptions,
1639
- module: Module,
1640
- loc: DependencyLocation,
1641
- request: string
1658
+ module?: Module,
1659
+ loc?: SyntheticDependencyLocation | RealDependencyLocation,
1660
+ request?: string
1642
1661
  ): ChunkGroup;
1643
1662
  addAsyncEntrypoint(
1644
1663
  options: EntryOptions,
@@ -1689,7 +1708,7 @@ declare class Compilation {
1689
1708
  clearAssets(): void;
1690
1709
  createModuleAssets(): void;
1691
1710
  getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
1692
- createChunkAssets(callback: (err?: WebpackError) => void): void;
1711
+ createChunkAssets(callback: (err?: null | WebpackError) => void): void;
1693
1712
  getPath(
1694
1713
  filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
1695
1714
  data?: PathData
@@ -1725,17 +1744,20 @@ declare class Compilation {
1725
1744
  executeModule(
1726
1745
  module: Module,
1727
1746
  options: ExecuteModuleOptions,
1728
- callback: (err?: WebpackError, result?: ExecuteModuleResult) => void
1747
+ callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
1729
1748
  ): void;
1730
1749
  checkConstraints(): void;
1731
1750
  factorizeModule: {
1732
1751
  (
1733
1752
  options: FactorizeModuleOptions & { factoryResult?: false },
1734
- callback: (err?: WebpackError, result?: Module) => void
1753
+ callback: (err?: null | WebpackError, result?: Module) => void
1735
1754
  ): void;
1736
1755
  (
1737
1756
  options: FactorizeModuleOptions & { factoryResult: true },
1738
- callback: (err?: WebpackError, result?: ModuleFactoryResult) => void
1757
+ callback: (
1758
+ err?: null | WebpackError,
1759
+ result?: ModuleFactoryResult
1760
+ ) => void
1739
1761
  ): void;
1740
1762
  };
1741
1763
 
@@ -1878,6 +1900,8 @@ declare class Compiler {
1878
1900
  make: AsyncParallelHook<[Compilation]>;
1879
1901
  finishMake: AsyncParallelHook<[Compilation]>;
1880
1902
  afterCompile: AsyncSeriesHook<[Compilation]>;
1903
+ readRecords: AsyncSeriesHook<[]>;
1904
+ emitRecords: AsyncSeriesHook<[]>;
1881
1905
  watchRun: AsyncSeriesHook<[Compiler]>;
1882
1906
  failed: SyncHook<[Error]>;
1883
1907
  invalid: SyncHook<[null | string, number]>;
@@ -1933,7 +1957,11 @@ declare class Compiler {
1933
1957
  watch(watchOptions: WatchOptions, handler: CallbackFunction<Stats>): Watching;
1934
1958
  run(callback: CallbackFunction<Stats>): void;
1935
1959
  runAsChild(
1936
- callback: (err?: Error, entries?: Chunk[], compilation?: Compilation) => any
1960
+ callback: (
1961
+ err?: null | Error,
1962
+ entries?: Chunk[],
1963
+ compilation?: Compilation
1964
+ ) => any
1937
1965
  ): void;
1938
1966
  purgeInputFileSystem(): void;
1939
1967
  emitAssets(compilation: Compilation, callback: CallbackFunction<void>): void;
@@ -2095,6 +2123,7 @@ declare interface Configuration {
2095
2123
  | "commonjs"
2096
2124
  | "commonjs2"
2097
2125
  | "commonjs-module"
2126
+ | "commonjs-static"
2098
2127
  | "amd"
2099
2128
  | "amd-require"
2100
2129
  | "umd"
@@ -2466,7 +2495,10 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
2466
2495
  resolveDependencies(
2467
2496
  fs: InputFileSystem,
2468
2497
  options: ContextModuleOptions,
2469
- callback: (err?: Error, dependencies?: ContextElementDependency[]) => any
2498
+ callback: (
2499
+ err?: null | Error,
2500
+ dependencies?: ContextElementDependency[]
2501
+ ) => any
2470
2502
  ): void;
2471
2503
  }
2472
2504
 
@@ -2516,6 +2548,16 @@ declare interface ContextTimestampAndHash {
2516
2548
  }
2517
2549
  type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
2518
2550
  Record<string, any>;
2551
+
2552
+ /**
2553
+ * Options for css handling.
2554
+ */
2555
+ declare interface CssExperimentOptions {
2556
+ /**
2557
+ * Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
2558
+ */
2559
+ exportsOnly?: boolean;
2560
+ }
2519
2561
  type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
2520
2562
  declare class DefinePlugin {
2521
2563
  /**
@@ -2582,6 +2624,12 @@ declare class Dependency {
2582
2624
  readonly type: string;
2583
2625
  readonly category: string;
2584
2626
  loc: DependencyLocation;
2627
+ setLoc(
2628
+ startLine?: any,
2629
+ startColumn?: any,
2630
+ endLine?: any,
2631
+ endColumn?: any
2632
+ ): void;
2585
2633
  getResourceIdentifier(): null | string;
2586
2634
  couldAffectReferencingModule(): boolean | typeof TRANSITIVE;
2587
2635
 
@@ -2697,6 +2745,11 @@ declare interface DependencyTemplateContext {
2697
2745
  * when in a concatenated module, information about other concatenated modules
2698
2746
  */
2699
2747
  concatenationScope?: ConcatenationScope;
2748
+
2749
+ /**
2750
+ * the code generation results
2751
+ */
2752
+ codeGenerationResults: CodeGenerationResults;
2700
2753
  }
2701
2754
  declare abstract class DependencyTemplates {
2702
2755
  get(dependency: DependencyConstructor): DependencyTemplate;
@@ -2718,8 +2771,58 @@ declare class DeterministicChunkIdsPlugin {
2718
2771
  apply(compiler: Compiler): void;
2719
2772
  }
2720
2773
  declare class DeterministicModuleIdsPlugin {
2721
- constructor(options?: any);
2722
- options: any;
2774
+ constructor(options?: {
2775
+ /**
2776
+ * context relative to which module identifiers are computed
2777
+ */
2778
+ context?: string;
2779
+ /**
2780
+ * selector function for modules
2781
+ */
2782
+ test?: (arg0: Module) => boolean;
2783
+ /**
2784
+ * maximum id length in digits (used as starting point)
2785
+ */
2786
+ maxLength?: number;
2787
+ /**
2788
+ * hash salt for ids
2789
+ */
2790
+ salt?: number;
2791
+ /**
2792
+ * do not increase the maxLength to find an optimal id space size
2793
+ */
2794
+ fixedLength?: boolean;
2795
+ /**
2796
+ * throw an error when id conflicts occur (instead of rehashing)
2797
+ */
2798
+ failOnConflict?: boolean;
2799
+ });
2800
+ options: {
2801
+ /**
2802
+ * context relative to which module identifiers are computed
2803
+ */
2804
+ context?: string;
2805
+ /**
2806
+ * selector function for modules
2807
+ */
2808
+ test?: (arg0: Module) => boolean;
2809
+ /**
2810
+ * maximum id length in digits (used as starting point)
2811
+ */
2812
+ maxLength?: number;
2813
+ /**
2814
+ * hash salt for ids
2815
+ */
2816
+ salt?: number;
2817
+ /**
2818
+ * do not increase the maxLength to find an optimal id space size
2819
+ */
2820
+ fixedLength?: boolean;
2821
+ /**
2822
+ * throw an error when id conflicts occur (instead of rehashing)
2823
+ */
2824
+ failOnConflict?: boolean;
2825
+ };
2723
2826
 
2724
2827
  /**
2725
2828
  * Apply the plugin
@@ -3373,6 +3476,11 @@ declare interface ExperimentsExtra {
3373
3476
  */
3374
3477
  buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
3375
3478
 
3479
+ /**
3480
+ * Enable css support.
3481
+ */
3482
+ css?: boolean | CssExperimentOptions;
3483
+
3376
3484
  /**
3377
3485
  * Compile entrypoints and import()s only when they are accessed.
3378
3486
  */
@@ -3389,6 +3497,11 @@ declare interface ExperimentsNormalizedExtra {
3389
3497
  */
3390
3498
  buildHttp?: HttpUriOptions;
3391
3499
 
3500
+ /**
3501
+ * Enable css support.
3502
+ */
3503
+ css?: CssExperimentOptions;
3504
+
3392
3505
  /**
3393
3506
  * Compile entrypoints and import()s only when they are accessed.
3394
3507
  */
@@ -3853,6 +3966,7 @@ type ExternalsType =
3853
3966
  | "commonjs"
3854
3967
  | "commonjs2"
3855
3968
  | "commonjs-module"
3969
+ | "commonjs-static"
3856
3970
  | "amd"
3857
3971
  | "amd-require"
3858
3972
  | "umd"
@@ -4092,40 +4206,43 @@ declare abstract class FileSystemInfo {
4092
4206
  getFileTimestamp(
4093
4207
  path: string,
4094
4208
  callback: (
4095
- arg0?: WebpackError,
4209
+ arg0?: null | WebpackError,
4096
4210
  arg1?: null | FileSystemInfoEntry | "ignore"
4097
4211
  ) => void
4098
4212
  ): void;
4099
4213
  getContextTimestamp(
4100
4214
  path: string,
4101
4215
  callback: (
4102
- arg0?: WebpackError,
4216
+ arg0?: null | WebpackError,
4103
4217
  arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
4104
4218
  ) => void
4105
4219
  ): void;
4106
4220
  getFileHash(
4107
4221
  path: string,
4108
- callback: (arg0?: WebpackError, arg1?: string) => void
4222
+ callback: (arg0?: null | WebpackError, arg1?: string) => void
4109
4223
  ): void;
4110
4224
  getContextHash(
4111
4225
  path: string,
4112
- callback: (arg0?: WebpackError, arg1?: string) => void
4226
+ callback: (arg0?: null | WebpackError, arg1?: string) => void
4113
4227
  ): void;
4114
4228
  getContextTsh(
4115
4229
  path: string,
4116
4230
  callback: (
4117
- arg0?: WebpackError,
4231
+ arg0?: null | WebpackError,
4118
4232
  arg1?: ResolvedContextTimestampAndHash
4119
4233
  ) => void
4120
4234
  ): void;
4121
4235
  resolveBuildDependencies(
4122
4236
  context: string,
4123
4237
  deps: Iterable<string>,
4124
- callback: (arg0?: Error, arg1?: ResolveBuildDependenciesResult) => void
4238
+ callback: (
4239
+ arg0?: null | Error,
4240
+ arg1?: ResolveBuildDependenciesResult
4241
+ ) => void
4125
4242
  ): void;
4126
4243
  checkResolveResultsValid(
4127
4244
  resolveResults: Map<string, string | false>,
4128
- callback: (arg0?: Error, arg1?: boolean) => void
4245
+ callback: (arg0?: null | Error, arg1?: boolean) => void
4129
4246
  ): void;
4130
4247
  createSnapshot(
4131
4248
  startTime: number,
@@ -4142,12 +4259,12 @@ declare abstract class FileSystemInfo {
4142
4259
  */
4143
4260
  timestamp?: boolean;
4144
4261
  },
4145
- callback: (arg0?: WebpackError, arg1?: Snapshot) => void
4262
+ callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
4146
4263
  ): void;
4147
4264
  mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
4148
4265
  checkSnapshotValid(
4149
4266
  snapshot: Snapshot,
4150
- callback: (arg0?: WebpackError, arg1?: boolean) => void
4267
+ callback: (arg0?: null | WebpackError, arg1?: boolean) => void
4151
4268
  ): void;
4152
4269
  getDeprecatedFileTimestamps(): Map<any, any>;
4153
4270
  getDeprecatedContextTimestamps(): Map<any, any>;
@@ -4197,6 +4314,11 @@ declare interface GenerateContext {
4197
4314
  */
4198
4315
  concatenationScope?: ConcatenationScope;
4199
4316
 
4317
+ /**
4318
+ * code generation results of other modules (need to have a codeGenerationDependency to use that)
4319
+ */
4320
+ codeGenerationResults?: CodeGenerationResults;
4321
+
4200
4322
  /**
4201
4323
  * which kind of code should be generated
4202
4324
  */
@@ -5350,6 +5472,11 @@ declare interface JavascriptParserOptions {
5350
5472
  */
5351
5473
  importExportsPresence?: false | "auto" | "error" | "warn";
5352
5474
 
5475
+ /**
5476
+ * Enable/disable evaluating import.meta.
5477
+ */
5478
+ importMeta?: boolean;
5479
+
5353
5480
  /**
5354
5481
  * Include polyfills or mocks for various node stuff.
5355
5482
  */
@@ -6005,7 +6132,7 @@ declare interface LibraryOptions {
6005
6132
  name?: string | string[] | LibraryCustomUmdObject;
6006
6133
 
6007
6134
  /**
6008
- * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
6135
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
6009
6136
  */
6010
6137
  type: string;
6011
6138
 
@@ -6187,7 +6314,7 @@ declare interface LoaderPluginLoaderContext {
6187
6314
  importModule(
6188
6315
  request: string,
6189
6316
  options: ImportModuleOptions,
6190
- callback: (err?: Error, exports?: any) => any
6317
+ callback: (err?: null | Error, exports?: any) => any
6191
6318
  ): void;
6192
6319
  importModule(request: string, options?: ImportModuleOptions): Promise<any>;
6193
6320
  }
@@ -6492,6 +6619,7 @@ declare class Module extends DependenciesBlock {
6492
6619
  buildMeta: BuildMeta;
6493
6620
  buildInfo: Record<string, any>;
6494
6621
  presentationalDependencies?: Dependency[];
6622
+ codeGenerationDependencies?: Dependency[];
6495
6623
  id: string | number;
6496
6624
  readonly hash: string;
6497
6625
  readonly renderedHash: string;
@@ -6521,6 +6649,7 @@ declare class Module extends DependenciesBlock {
6521
6649
  strict: boolean
6522
6650
  ): "namespace" | "default-only" | "default-with-named" | "dynamic";
6523
6651
  addPresentationalDependency(presentationalDependency: Dependency): void;
6652
+ addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
6524
6653
  addWarning(warning: WebpackError): void;
6525
6654
  getWarnings(): undefined | Iterable<WebpackError>;
6526
6655
  getNumberOfWarnings(): number;
@@ -6551,7 +6680,7 @@ declare class Module extends DependenciesBlock {
6551
6680
  hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
6552
6681
  needBuild(
6553
6682
  context: NeedBuildContext,
6554
- callback: (arg0?: WebpackError, arg1?: boolean) => void
6683
+ callback: (arg0?: null | WebpackError, arg1?: boolean) => void
6555
6684
  ): void;
6556
6685
  needRebuild(
6557
6686
  fileTimestamps: Map<string, null | number>,
@@ -6708,6 +6837,7 @@ declare interface ModuleFederationPluginOptions {
6708
6837
  | "commonjs"
6709
6838
  | "commonjs2"
6710
6839
  | "commonjs-module"
6840
+ | "commonjs-static"
6711
6841
  | "amd"
6712
6842
  | "amd-require"
6713
6843
  | "umd"
@@ -7420,7 +7550,7 @@ declare class NormalModule extends Module {
7420
7550
  resourceResolveData?: Record<string, any>;
7421
7551
  matchResource?: string;
7422
7552
  loaders: LoaderItem[];
7423
- error?: WebpackError;
7553
+ error?: null | WebpackError;
7424
7554
  restoreFromUnsafeCache(
7425
7555
  unsafeCacheData?: any,
7426
7556
  normalModuleFactory?: any
@@ -8139,6 +8269,20 @@ declare interface Output {
8139
8269
  */
8140
8270
  crossOriginLoading?: false | "anonymous" | "use-credentials";
8141
8271
 
8272
+ /**
8273
+ * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
8274
+ */
8275
+ cssChunkFilename?:
8276
+ | string
8277
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8278
+
8279
+ /**
8280
+ * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
8281
+ */
8282
+ cssFilename?:
8283
+ | string
8284
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8285
+
8142
8286
  /**
8143
8287
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
8144
8288
  */
@@ -8245,7 +8389,7 @@ declare interface Output {
8245
8389
  libraryExport?: string | string[];
8246
8390
 
8247
8391
  /**
8248
- * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
8392
+ * Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
8249
8393
  */
8250
8394
  libraryTarget?: string;
8251
8395
 
@@ -8434,6 +8578,20 @@ declare interface OutputNormalized {
8434
8578
  */
8435
8579
  crossOriginLoading?: false | "anonymous" | "use-credentials";
8436
8580
 
8581
+ /**
8582
+ * Specifies the filename template of non-initial output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
8583
+ */
8584
+ cssChunkFilename?:
8585
+ | string
8586
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8587
+
8588
+ /**
8589
+ * Specifies the filename template of output css files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
8590
+ */
8591
+ cssFilename?:
8592
+ | string
8593
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8594
+
8437
8595
  /**
8438
8596
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
8439
8597
  */
@@ -10413,6 +10571,24 @@ declare abstract class RuntimeTemplate {
10413
10571
  */
10414
10572
  runtimeRequirements: Set<string>;
10415
10573
  }): string;
10574
+ assetUrl(__0: {
10575
+ /**
10576
+ * the module
10577
+ */
10578
+ module: Module;
10579
+ /**
10580
+ * the public path
10581
+ */
10582
+ publicPath: string;
10583
+ /**
10584
+ * runtime
10585
+ */
10586
+ runtime?: RuntimeSpec;
10587
+ /**
10588
+ * the code generation results
10589
+ */
10590
+ codeGenerationResults: CodeGenerationResults;
10591
+ }): string;
10416
10592
  }
10417
10593
  declare abstract class RuntimeValue {
10418
10594
  fn: (arg0: {
@@ -11430,6 +11606,31 @@ type StatsValue =
11430
11606
  | "minimal"
11431
11607
  | "normal"
11432
11608
  | "detailed";
11609
+ declare class SyncModuleIdsPlugin {
11610
+ constructor(__0: {
11611
+ /**
11612
+ * path to file
11613
+ */
11614
+ path: string;
11615
+ /**
11616
+ * context for module names
11617
+ */
11618
+ context?: string;
11619
+ /**
11620
+ * selector for modules
11621
+ */
11622
+ test: (arg0: Module) => boolean;
11623
+ /**
11624
+ * operation mode (defaults to merge)
11625
+ */
11626
+ mode?: "read" | "create" | "merge" | "update";
11627
+ });
11628
+
11629
+ /**
11630
+ * Apply the plugin
11631
+ */
11632
+ apply(compiler: Compiler): void;
11633
+ }
11433
11634
  declare interface SyntheticDependencyLocation {
11434
11635
  name: string;
11435
11636
  index?: number;
@@ -12007,6 +12208,7 @@ declare interface WebpackOptionsNormalized {
12007
12208
  | "commonjs"
12008
12209
  | "commonjs2"
12009
12210
  | "commonjs-module"
12211
+ | "commonjs-static"
12010
12212
  | "amd"
12011
12213
  | "amd-require"
12012
12214
  | "umd"
@@ -12298,11 +12500,16 @@ declare namespace exports {
12298
12500
  export let uncaughtErrorHandler: string;
12299
12501
  export let scriptNonce: string;
12300
12502
  export let loadScript: string;
12503
+ export let createScript: string;
12301
12504
  export let createScriptUrl: string;
12505
+ export let getTrustedTypesPolicy: string;
12302
12506
  export let chunkName: string;
12303
12507
  export let runtimeId: string;
12304
12508
  export let getChunkScriptFilename: string;
12509
+ export let getChunkCssFilename: string;
12510
+ export let hasCssModules: string;
12305
12511
  export let getChunkUpdateScriptFilename: string;
12512
+ export let getChunkUpdateCssFilename: string;
12306
12513
  export let startup: string;
12307
12514
  export let startupNoDefault: string;
12308
12515
  export let startupOnlyAfter: string;
@@ -12638,6 +12845,9 @@ declare namespace exports {
12638
12845
  export namespace schemes {
12639
12846
  export { HttpUriPlugin };
12640
12847
  }
12848
+ export namespace ids {
12849
+ export { SyncModuleIdsPlugin };
12850
+ }
12641
12851
  }
12642
12852
  export type WebpackPluginFunction = (
12643
12853
  this: Compiler,