webpack 5.64.3 → 5.67.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 (121) hide show
  1. package/README.md +1 -1
  2. package/lib/Cache.js +1 -1
  3. package/lib/CacheFacade.js +4 -11
  4. package/lib/Chunk.js +2 -0
  5. package/lib/CleanPlugin.js +1 -1
  6. package/lib/Compilation.js +91 -47
  7. package/lib/Compiler.js +57 -3
  8. package/lib/ContextModule.js +21 -17
  9. package/lib/DelegatedModule.js +1 -1
  10. package/lib/Dependency.js +10 -0
  11. package/lib/DependencyTemplate.js +9 -0
  12. package/lib/DependencyTemplates.js +1 -1
  13. package/lib/DllModule.js +1 -1
  14. package/lib/EvalDevToolModulePlugin.js +16 -1
  15. package/lib/EvalSourceMapDevToolPlugin.js +18 -1
  16. package/lib/ExternalModule.js +94 -54
  17. package/lib/ExternalModuleFactoryPlugin.js +1 -1
  18. package/lib/FileSystemInfo.js +29 -25
  19. package/lib/Generator.js +2 -0
  20. package/lib/HookWebpackError.js +1 -1
  21. package/lib/Module.js +25 -2
  22. package/lib/ModuleFilenameHelpers.js +5 -1
  23. package/lib/MultiCompiler.js +1 -1
  24. package/lib/MultiWatching.js +1 -1
  25. package/lib/NormalModule.js +9 -5
  26. package/lib/RawModule.js +1 -1
  27. package/lib/RuntimeGlobals.js +29 -1
  28. package/lib/RuntimeModule.js +1 -1
  29. package/lib/RuntimePlugin.js +50 -0
  30. package/lib/RuntimeTemplate.js +113 -2
  31. package/lib/Template.js +2 -1
  32. package/lib/WatchIgnorePlugin.js +14 -1
  33. package/lib/Watching.js +33 -19
  34. package/lib/WebpackOptionsApply.js +43 -2
  35. package/lib/asset/AssetGenerator.js +71 -30
  36. package/lib/asset/AssetModulesPlugin.js +3 -0
  37. package/lib/asset/RawDataUrlModule.js +148 -0
  38. package/lib/cache/ResolverCachePlugin.js +1 -1
  39. package/lib/cli.js +44 -3
  40. package/lib/config/browserslistTargetHandler.js +38 -1
  41. package/lib/config/defaults.js +79 -6
  42. package/lib/config/normalization.js +5 -0
  43. package/lib/config/target.js +10 -0
  44. package/lib/container/ContainerEntryModule.js +8 -5
  45. package/lib/container/FallbackModule.js +4 -4
  46. package/lib/container/RemoteModule.js +4 -2
  47. package/lib/css/CssExportsGenerator.js +139 -0
  48. package/lib/css/CssGenerator.js +109 -0
  49. package/lib/css/CssLoadingRuntimeModule.js +447 -0
  50. package/lib/css/CssModulesPlugin.js +461 -0
  51. package/lib/css/CssParser.js +618 -0
  52. package/lib/css/walkCssTokens.js +659 -0
  53. package/lib/debug/ProfilingPlugin.js +12 -10
  54. package/lib/dependencies/CreateScriptUrlDependency.js +12 -0
  55. package/lib/dependencies/CssExportDependency.js +85 -0
  56. package/lib/dependencies/CssImportDependency.js +75 -0
  57. package/lib/dependencies/CssLocalIdentifierDependency.js +119 -0
  58. package/lib/dependencies/CssSelfLocalIdentifierDependency.js +101 -0
  59. package/lib/dependencies/CssUrlDependency.js +132 -0
  60. package/lib/dependencies/LoaderPlugin.js +2 -2
  61. package/lib/dependencies/URLDependency.js +3 -8
  62. package/lib/esm/ModuleChunkFormatPlugin.js +74 -49
  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 +8 -0
  74. package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -2
  75. package/lib/javascript/ChunkHelpers.js +33 -0
  76. package/lib/javascript/JavascriptGenerator.js +1 -0
  77. package/lib/javascript/JavascriptParser.js +16 -8
  78. package/lib/javascript/StartupHelpers.js +4 -28
  79. package/lib/library/AssignLibraryPlugin.js +31 -13
  80. package/lib/library/EnableLibraryPlugin.js +11 -0
  81. package/lib/node/NodeWatchFileSystem.js +85 -31
  82. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +1 -1
  83. package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -1
  84. package/lib/optimize/ConcatenatedModule.js +11 -5
  85. package/lib/runtime/CreateScriptRuntimeModule.js +36 -0
  86. package/lib/runtime/CreateScriptUrlRuntimeModule.js +9 -34
  87. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +76 -0
  88. package/lib/schemes/HttpUriPlugin.js +8 -8
  89. package/lib/sharing/ConsumeSharedModule.js +8 -2
  90. package/lib/sharing/ConsumeSharedRuntimeModule.js +25 -4
  91. package/lib/sharing/ProvideSharedModule.js +4 -2
  92. package/lib/sharing/utils.js +1 -1
  93. package/lib/stats/DefaultStatsFactoryPlugin.js +112 -67
  94. package/lib/stats/DefaultStatsPrinterPlugin.js +89 -24
  95. package/lib/util/AsyncQueue.js +1 -1
  96. package/lib/util/extractUrlAndGlobal.js +3 -0
  97. package/lib/util/fs.js +10 -0
  98. package/lib/util/hash/xxhash64.js +2 -2
  99. package/lib/util/internalSerializables.js +11 -0
  100. package/lib/web/JsonpChunkLoadingRuntimeModule.js +3 -3
  101. package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -11
  102. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +3 -2
  103. package/package.json +5 -12
  104. package/schemas/WebpackOptions.check.js +1 -1
  105. package/schemas/WebpackOptions.json +100 -1
  106. package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
  107. package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
  108. package/schemas/plugins/container/ContainerPlugin.check.js +1 -1
  109. package/schemas/plugins/container/ContainerPlugin.json +2 -1
  110. package/schemas/plugins/container/ContainerReferencePlugin.check.js +1 -1
  111. package/schemas/plugins/container/ContainerReferencePlugin.json +1 -0
  112. package/schemas/plugins/container/ExternalsType.check.js +1 -1
  113. package/schemas/plugins/container/ModuleFederationPlugin.check.js +1 -1
  114. package/schemas/plugins/container/ModuleFederationPlugin.json +3 -1
  115. package/schemas/plugins/css/CssGeneratorOptions.check.d.ts +7 -0
  116. package/schemas/plugins/css/CssGeneratorOptions.check.js +6 -0
  117. package/schemas/plugins/css/CssGeneratorOptions.json +3 -0
  118. package/schemas/plugins/css/CssParserOptions.check.d.ts +7 -0
  119. package/schemas/plugins/css/CssParserOptions.check.js +6 -0
  120. package/schemas/plugins/css/CssParserOptions.json +3 -0
  121. package/types.d.ts +305 -58
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"
@@ -2141,7 +2170,7 @@ declare interface Configuration {
2141
2170
  /**
2142
2171
  * Enable production optimizations or development hints.
2143
2172
  */
2144
- mode?: "development" | "production" | "none";
2173
+ mode?: "none" | "development" | "production";
2145
2174
 
2146
2175
  /**
2147
2176
  * Options affecting the normal modules (`NormalModuleFactory`).
@@ -2226,15 +2255,15 @@ declare interface Configuration {
2226
2255
  */
2227
2256
  stats?:
2228
2257
  | boolean
2258
+ | StatsOptions
2229
2259
  | "none"
2260
+ | "verbose"
2230
2261
  | "summary"
2231
2262
  | "errors-only"
2232
2263
  | "errors-warnings"
2233
2264
  | "minimal"
2234
2265
  | "normal"
2235
- | "detailed"
2236
- | "verbose"
2237
- | StatsOptions;
2266
+ | "detailed";
2238
2267
 
2239
2268
  /**
2240
2269
  * Environment to build for. An array of environments to build for all of them when possible.
@@ -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
@@ -3246,6 +3349,16 @@ declare interface Environment {
3246
3349
  * The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
3247
3350
  */
3248
3351
  module?: boolean;
3352
+
3353
+ /**
3354
+ * The environment supports optional chaining ('obj?.a' or 'obj?.()').
3355
+ */
3356
+ optionalChaining?: boolean;
3357
+
3358
+ /**
3359
+ * The environment supports template literals.
3360
+ */
3361
+ templateLiteral?: boolean;
3249
3362
  }
3250
3363
  declare class EnvironmentPlugin {
3251
3364
  constructor(...keys: any[]);
@@ -3363,6 +3476,11 @@ declare interface ExperimentsExtra {
3363
3476
  */
3364
3477
  buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
3365
3478
 
3479
+ /**
3480
+ * Enable css support.
3481
+ */
3482
+ css?: boolean | CssExperimentOptions;
3483
+
3366
3484
  /**
3367
3485
  * Compile entrypoints and import()s only when they are accessed.
3368
3486
  */
@@ -3379,6 +3497,11 @@ declare interface ExperimentsNormalizedExtra {
3379
3497
  */
3380
3498
  buildHttp?: HttpUriOptions;
3381
3499
 
3500
+ /**
3501
+ * Enable css support.
3502
+ */
3503
+ css?: CssExperimentOptions;
3504
+
3382
3505
  /**
3383
3506
  * Compile entrypoints and import()s only when they are accessed.
3384
3507
  */
@@ -3843,6 +3966,7 @@ type ExternalsType =
3843
3966
  | "commonjs"
3844
3967
  | "commonjs2"
3845
3968
  | "commonjs-module"
3969
+ | "commonjs-static"
3846
3970
  | "amd"
3847
3971
  | "amd-require"
3848
3972
  | "umd"
@@ -4082,40 +4206,43 @@ declare abstract class FileSystemInfo {
4082
4206
  getFileTimestamp(
4083
4207
  path: string,
4084
4208
  callback: (
4085
- arg0?: WebpackError,
4209
+ arg0?: null | WebpackError,
4086
4210
  arg1?: null | FileSystemInfoEntry | "ignore"
4087
4211
  ) => void
4088
4212
  ): void;
4089
4213
  getContextTimestamp(
4090
4214
  path: string,
4091
4215
  callback: (
4092
- arg0?: WebpackError,
4216
+ arg0?: null | WebpackError,
4093
4217
  arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
4094
4218
  ) => void
4095
4219
  ): void;
4096
4220
  getFileHash(
4097
4221
  path: string,
4098
- callback: (arg0?: WebpackError, arg1?: string) => void
4222
+ callback: (arg0?: null | WebpackError, arg1?: string) => void
4099
4223
  ): void;
4100
4224
  getContextHash(
4101
4225
  path: string,
4102
- callback: (arg0?: WebpackError, arg1?: string) => void
4226
+ callback: (arg0?: null | WebpackError, arg1?: string) => void
4103
4227
  ): void;
4104
4228
  getContextTsh(
4105
4229
  path: string,
4106
4230
  callback: (
4107
- arg0?: WebpackError,
4231
+ arg0?: null | WebpackError,
4108
4232
  arg1?: ResolvedContextTimestampAndHash
4109
4233
  ) => void
4110
4234
  ): void;
4111
4235
  resolveBuildDependencies(
4112
4236
  context: string,
4113
4237
  deps: Iterable<string>,
4114
- callback: (arg0?: Error, arg1?: ResolveBuildDependenciesResult) => void
4238
+ callback: (
4239
+ arg0?: null | Error,
4240
+ arg1?: ResolveBuildDependenciesResult
4241
+ ) => void
4115
4242
  ): void;
4116
4243
  checkResolveResultsValid(
4117
4244
  resolveResults: Map<string, string | false>,
4118
- callback: (arg0?: Error, arg1?: boolean) => void
4245
+ callback: (arg0?: null | Error, arg1?: boolean) => void
4119
4246
  ): void;
4120
4247
  createSnapshot(
4121
4248
  startTime: number,
@@ -4132,12 +4259,12 @@ declare abstract class FileSystemInfo {
4132
4259
  */
4133
4260
  timestamp?: boolean;
4134
4261
  },
4135
- callback: (arg0?: WebpackError, arg1?: Snapshot) => void
4262
+ callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
4136
4263
  ): void;
4137
4264
  mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
4138
4265
  checkSnapshotValid(
4139
4266
  snapshot: Snapshot,
4140
- callback: (arg0?: WebpackError, arg1?: boolean) => void
4267
+ callback: (arg0?: null | WebpackError, arg1?: boolean) => void
4141
4268
  ): void;
4142
4269
  getDeprecatedFileTimestamps(): Map<any, any>;
4143
4270
  getDeprecatedContextTimestamps(): Map<any, any>;
@@ -4187,6 +4314,11 @@ declare interface GenerateContext {
4187
4314
  */
4188
4315
  concatenationScope?: ConcatenationScope;
4189
4316
 
4317
+ /**
4318
+ * code generation results of other modules (need to have a codeGenerationDependency to use that)
4319
+ */
4320
+ codeGenerationResults?: CodeGenerationResults;
4321
+
4190
4322
  /**
4191
4323
  * which kind of code should be generated
4192
4324
  */
@@ -4547,7 +4679,7 @@ declare interface InfrastructureLogging {
4547
4679
  /**
4548
4680
  * Log level.
4549
4681
  */
4550
- level?: "none" | "verbose" | "error" | "warn" | "info" | "log";
4682
+ level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
4551
4683
 
4552
4684
  /**
4553
4685
  * Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
@@ -4693,7 +4825,7 @@ declare class JavascriptModulesPlugin {
4693
4825
  static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
4694
4826
  }
4695
4827
  declare class JavascriptParser extends Parser {
4696
- constructor(sourceType?: "module" | "script" | "auto");
4828
+ constructor(sourceType?: "module" | "auto" | "script");
4697
4829
  hooks: Readonly<{
4698
4830
  evaluateTypeof: HookMap<
4699
4831
  SyncBailHook<
@@ -4963,7 +5095,7 @@ declare class JavascriptParser extends Parser {
4963
5095
  program: SyncBailHook<[Program, Comment[]], boolean | void>;
4964
5096
  finish: SyncBailHook<[Program, Comment[]], boolean | void>;
4965
5097
  }>;
4966
- sourceType: "module" | "script" | "auto";
5098
+ sourceType: "module" | "auto" | "script";
4967
5099
  scope: ScopeInfo;
4968
5100
  state: ParserState;
4969
5101
  comments: any;
@@ -5303,7 +5435,7 @@ declare interface JavascriptParserOptions {
5303
5435
  /**
5304
5436
  * Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
5305
5437
  */
5306
- exportsPresence?: false | "error" | "warn" | "auto";
5438
+ exportsPresence?: false | "auto" | "error" | "warn";
5307
5439
 
5308
5440
  /**
5309
5441
  * Enable warnings for full dynamic dependencies.
@@ -5338,7 +5470,7 @@ declare interface JavascriptParserOptions {
5338
5470
  /**
5339
5471
  * Specifies the behavior of invalid export names in "import ... from ...".
5340
5472
  */
5341
- importExportsPresence?: false | "error" | "warn" | "auto";
5473
+ importExportsPresence?: false | "auto" | "error" | "warn";
5342
5474
 
5343
5475
  /**
5344
5476
  * Include polyfills or mocks for various node stuff.
@@ -5348,7 +5480,7 @@ declare interface JavascriptParserOptions {
5348
5480
  /**
5349
5481
  * Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
5350
5482
  */
5351
- reexportExportsPresence?: false | "error" | "warn" | "auto";
5483
+ reexportExportsPresence?: false | "auto" | "error" | "warn";
5352
5484
 
5353
5485
  /**
5354
5486
  * Enable/disable parsing of require.context syntax.
@@ -5585,7 +5717,7 @@ declare interface KnownNormalizedStatsOptions {
5585
5717
  modulesSpace: number;
5586
5718
  chunkModulesSpace: number;
5587
5719
  nestedModulesSpace: number;
5588
- logging: false | "none" | "verbose" | "error" | "warn" | "info" | "log";
5720
+ logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
5589
5721
  loggingDebug: ((value: string) => boolean)[];
5590
5722
  loggingTrace: boolean;
5591
5723
  }
@@ -5995,7 +6127,7 @@ declare interface LibraryOptions {
5995
6127
  name?: string | string[] | LibraryCustomUmdObject;
5996
6128
 
5997
6129
  /**
5998
- * 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).
6130
+ * 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).
5999
6131
  */
6000
6132
  type: string;
6001
6133
 
@@ -6177,7 +6309,7 @@ declare interface LoaderPluginLoaderContext {
6177
6309
  importModule(
6178
6310
  request: string,
6179
6311
  options: ImportModuleOptions,
6180
- callback: (err?: Error, exports?: any) => any
6312
+ callback: (err?: null | Error, exports?: any) => any
6181
6313
  ): void;
6182
6314
  importModule(request: string, options?: ImportModuleOptions): Promise<any>;
6183
6315
  }
@@ -6482,6 +6614,7 @@ declare class Module extends DependenciesBlock {
6482
6614
  buildMeta: BuildMeta;
6483
6615
  buildInfo: Record<string, any>;
6484
6616
  presentationalDependencies?: Dependency[];
6617
+ codeGenerationDependencies?: Dependency[];
6485
6618
  id: string | number;
6486
6619
  readonly hash: string;
6487
6620
  readonly renderedHash: string;
@@ -6511,6 +6644,7 @@ declare class Module extends DependenciesBlock {
6511
6644
  strict: boolean
6512
6645
  ): "namespace" | "default-only" | "default-with-named" | "dynamic";
6513
6646
  addPresentationalDependency(presentationalDependency: Dependency): void;
6647
+ addCodeGenerationDependency(codeGenerationDependency: Dependency): void;
6514
6648
  addWarning(warning: WebpackError): void;
6515
6649
  getWarnings(): undefined | Iterable<WebpackError>;
6516
6650
  getNumberOfWarnings(): number;
@@ -6541,7 +6675,7 @@ declare class Module extends DependenciesBlock {
6541
6675
  hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
6542
6676
  needBuild(
6543
6677
  context: NeedBuildContext,
6544
- callback: (arg0?: WebpackError, arg1?: boolean) => void
6678
+ callback: (arg0?: null | WebpackError, arg1?: boolean) => void
6545
6679
  ): void;
6546
6680
  needRebuild(
6547
6681
  fileTimestamps: Map<string, null | number>,
@@ -6698,6 +6832,7 @@ declare interface ModuleFederationPluginOptions {
6698
6832
  | "commonjs"
6699
6833
  | "commonjs2"
6700
6834
  | "commonjs-module"
6835
+ | "commonjs-static"
6701
6836
  | "amd"
6702
6837
  | "amd-require"
6703
6838
  | "umd"
@@ -7410,7 +7545,7 @@ declare class NormalModule extends Module {
7410
7545
  resourceResolveData?: Record<string, any>;
7411
7546
  matchResource?: string;
7412
7547
  loaders: LoaderItem[];
7413
- error?: WebpackError;
7548
+ error?: null | WebpackError;
7414
7549
  restoreFromUnsafeCache(
7415
7550
  unsafeCacheData?: any,
7416
7551
  normalModuleFactory?: any
@@ -7543,7 +7678,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
7543
7678
  rootContext: string;
7544
7679
  fs: InputFileSystem;
7545
7680
  sourceMap?: boolean;
7546
- mode: "development" | "production" | "none";
7681
+ mode: "none" | "development" | "production";
7547
7682
  webpack?: boolean;
7548
7683
  _module?: NormalModule;
7549
7684
  _compilation?: Compilation;
@@ -8129,6 +8264,20 @@ declare interface Output {
8129
8264
  */
8130
8265
  crossOriginLoading?: false | "anonymous" | "use-credentials";
8131
8266
 
8267
+ /**
8268
+ * 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.
8269
+ */
8270
+ cssChunkFilename?:
8271
+ | string
8272
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8273
+
8274
+ /**
8275
+ * 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.
8276
+ */
8277
+ cssFilename?:
8278
+ | string
8279
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8280
+
8132
8281
  /**
8133
8282
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
8134
8283
  */
@@ -8235,7 +8384,7 @@ declare interface Output {
8235
8384
  libraryExport?: string | string[];
8236
8385
 
8237
8386
  /**
8238
- * 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).
8387
+ * 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).
8239
8388
  */
8240
8389
  libraryTarget?: string;
8241
8390
 
@@ -8424,6 +8573,20 @@ declare interface OutputNormalized {
8424
8573
  */
8425
8574
  crossOriginLoading?: false | "anonymous" | "use-credentials";
8426
8575
 
8576
+ /**
8577
+ * 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.
8578
+ */
8579
+ cssChunkFilename?:
8580
+ | string
8581
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8582
+
8583
+ /**
8584
+ * 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.
8585
+ */
8586
+ cssFilename?:
8587
+ | string
8588
+ | ((pathData: PathData, assetInfo?: AssetInfo) => string);
8589
+
8427
8590
  /**
8428
8591
  * Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.
8429
8592
  */
@@ -9400,7 +9563,7 @@ declare interface ResolveOptionsWebpackOptions {
9400
9563
  /**
9401
9564
  * Plugins for the resolver.
9402
9565
  */
9403
- plugins?: ("..." | ResolvePluginInstance)[];
9566
+ plugins?: (ResolvePluginInstance | "...")[];
9404
9567
 
9405
9568
  /**
9406
9569
  * Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
@@ -10012,18 +10175,21 @@ declare abstract class RuntimeTemplate {
10012
10175
  compilation: Compilation;
10013
10176
  outputOptions: OutputNormalized;
10014
10177
  requestShortener: RequestShortener;
10178
+ globalObject: string;
10015
10179
  isIIFE(): undefined | boolean;
10016
10180
  isModule(): undefined | boolean;
10017
10181
  supportsConst(): undefined | boolean;
10018
10182
  supportsArrowFunction(): undefined | boolean;
10183
+ supportsOptionalChaining(): undefined | boolean;
10019
10184
  supportsForOf(): undefined | boolean;
10020
10185
  supportsDestructuring(): undefined | boolean;
10021
10186
  supportsBigIntLiteral(): undefined | boolean;
10022
10187
  supportsDynamicImport(): undefined | boolean;
10023
10188
  supportsEcmaScriptModuleSyntax(): undefined | boolean;
10024
- supportTemplateLiteral(): boolean;
10189
+ supportTemplateLiteral(): undefined | boolean;
10025
10190
  returningFunction(returnValue?: any, args?: string): string;
10026
10191
  basicFunction(args?: any, body?: any): string;
10192
+ concatenation(...args: (string | { expr: string })[]): string;
10027
10193
  expressionFunction(expression?: any, args?: string): string;
10028
10194
  emptyFunction(): "x => {}" | "function() {}";
10029
10195
  destructureArray(items?: any, value?: any): string;
@@ -10400,6 +10566,24 @@ declare abstract class RuntimeTemplate {
10400
10566
  */
10401
10567
  runtimeRequirements: Set<string>;
10402
10568
  }): string;
10569
+ assetUrl(__0: {
10570
+ /**
10571
+ * the module
10572
+ */
10573
+ module: Module;
10574
+ /**
10575
+ * the public path
10576
+ */
10577
+ publicPath: string;
10578
+ /**
10579
+ * runtime
10580
+ */
10581
+ runtime?: RuntimeSpec;
10582
+ /**
10583
+ * the code generation results
10584
+ */
10585
+ codeGenerationResults: CodeGenerationResults;
10586
+ }): string;
10403
10587
  }
10404
10588
  declare abstract class RuntimeValue {
10405
10589
  fn: (arg0: {
@@ -11239,7 +11423,7 @@ declare interface StatsOptions {
11239
11423
  /**
11240
11424
  * Add logging output.
11241
11425
  */
11242
- logging?: boolean | "none" | "verbose" | "error" | "warn" | "info" | "log";
11426
+ logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
11243
11427
 
11244
11428
  /**
11245
11429
  * Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
@@ -11408,15 +11592,40 @@ type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
11408
11592
  type StatsProfile = KnownStatsProfile & Record<string, any>;
11409
11593
  type StatsValue =
11410
11594
  | boolean
11595
+ | StatsOptions
11411
11596
  | "none"
11597
+ | "verbose"
11412
11598
  | "summary"
11413
11599
  | "errors-only"
11414
11600
  | "errors-warnings"
11415
11601
  | "minimal"
11416
11602
  | "normal"
11417
- | "detailed"
11418
- | "verbose"
11419
- | StatsOptions;
11603
+ | "detailed";
11604
+ declare class SyncModuleIdsPlugin {
11605
+ constructor(__0: {
11606
+ /**
11607
+ * path to file
11608
+ */
11609
+ path: string;
11610
+ /**
11611
+ * context for module names
11612
+ */
11613
+ context?: string;
11614
+ /**
11615
+ * selector for modules
11616
+ */
11617
+ test: (arg0: Module) => boolean;
11618
+ /**
11619
+ * operation mode (defaults to merge)
11620
+ */
11621
+ mode?: "read" | "create" | "merge" | "update";
11622
+ });
11623
+
11624
+ /**
11625
+ * Apply the plugin
11626
+ */
11627
+ apply(compiler: Compiler): void;
11628
+ }
11420
11629
  declare interface SyntheticDependencyLocation {
11421
11630
  name: string;
11422
11631
  index?: number;
@@ -11741,6 +11950,32 @@ declare interface Watcher {
11741
11950
  * get info about directories
11742
11951
  */
11743
11952
  getContextTimeInfoEntries: () => Map<string, FileSystemInfoEntry | "ignore">;
11953
+
11954
+ /**
11955
+ * get info about timestamps and changes
11956
+ */
11957
+ getInfo?: () => WatcherInfo;
11958
+ }
11959
+ declare interface WatcherInfo {
11960
+ /**
11961
+ * get current aggregated changes that have not yet send to callback
11962
+ */
11963
+ changes: Set<string>;
11964
+
11965
+ /**
11966
+ * get current aggregated removals that have not yet send to callback
11967
+ */
11968
+ removals: Set<string>;
11969
+
11970
+ /**
11971
+ * get info about files
11972
+ */
11973
+ fileTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
11974
+
11975
+ /**
11976
+ * get info about directories
11977
+ */
11978
+ contextTimeInfoEntries: Map<string, FileSystemInfoEntry | "ignore">;
11744
11979
  }
11745
11980
  declare abstract class Watching {
11746
11981
  startTime: null | number;
@@ -11968,6 +12203,7 @@ declare interface WebpackOptionsNormalized {
11968
12203
  | "commonjs"
11969
12204
  | "commonjs2"
11970
12205
  | "commonjs-module"
12206
+ | "commonjs-static"
11971
12207
  | "amd"
11972
12208
  | "amd-require"
11973
12209
  | "umd"
@@ -12000,7 +12236,7 @@ declare interface WebpackOptionsNormalized {
12000
12236
  /**
12001
12237
  * Enable production optimizations or development hints.
12002
12238
  */
12003
- mode?: "development" | "production" | "none";
12239
+ mode?: "none" | "development" | "production";
12004
12240
 
12005
12241
  /**
12006
12242
  * Options affecting the normal modules (`NormalModuleFactory`).
@@ -12259,11 +12495,16 @@ declare namespace exports {
12259
12495
  export let uncaughtErrorHandler: string;
12260
12496
  export let scriptNonce: string;
12261
12497
  export let loadScript: string;
12498
+ export let createScript: string;
12262
12499
  export let createScriptUrl: string;
12500
+ export let getTrustedTypesPolicy: string;
12263
12501
  export let chunkName: string;
12264
12502
  export let runtimeId: string;
12265
12503
  export let getChunkScriptFilename: string;
12504
+ export let getChunkCssFilename: string;
12505
+ export let hasCssModules: string;
12266
12506
  export let getChunkUpdateScriptFilename: string;
12507
+ export let getChunkUpdateCssFilename: string;
12267
12508
  export let startup: string;
12268
12509
  export let startupNoDefault: string;
12269
12510
  export let startupOnlyAfter: string;
@@ -12599,6 +12840,9 @@ declare namespace exports {
12599
12840
  export namespace schemes {
12600
12841
  export { HttpUriPlugin };
12601
12842
  }
12843
+ export namespace ids {
12844
+ export { SyncModuleIdsPlugin };
12845
+ }
12602
12846
  }
12603
12847
  export type WebpackPluginFunction = (
12604
12848
  this: Compiler,
@@ -12672,6 +12916,7 @@ declare namespace exports {
12672
12916
  RuleSetRule,
12673
12917
  RuleSetUse,
12674
12918
  RuleSetUseItem,
12919
+ StatsOptions,
12675
12920
  Configuration,
12676
12921
  WebpackOptionsNormalized,
12677
12922
  WebpackPluginInstance,
@@ -12679,6 +12924,8 @@ declare namespace exports {
12679
12924
  AssetInfo,
12680
12925
  MultiStats,
12681
12926
  ParserState,
12927
+ ResolvePluginInstance,
12928
+ Resolver,
12682
12929
  Watching,
12683
12930
  StatsAsset,
12684
12931
  StatsChunk,