webpack 5.66.0 → 5.69.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/README.md +1 -1
- package/lib/APIPlugin.js +33 -0
- package/lib/Cache.js +1 -1
- package/lib/CacheFacade.js +2 -2
- package/lib/ChunkGraph.js +1 -2
- package/lib/CleanPlugin.js +1 -1
- package/lib/Compilation.js +14 -9
- package/lib/Compiler.js +57 -3
- package/lib/ContextModule.js +21 -17
- package/lib/DelegatedModule.js +1 -1
- package/lib/DependencyTemplates.js +1 -1
- package/lib/DllModule.js +1 -1
- package/lib/EvalDevToolModulePlugin.js +16 -1
- package/lib/EvalSourceMapDevToolPlugin.js +18 -1
- package/lib/ExportsInfo.js +4 -4
- package/lib/ExternalModule.js +1 -1
- package/lib/ExternalModuleFactoryPlugin.js +1 -1
- package/lib/FileSystemInfo.js +29 -25
- package/lib/HookWebpackError.js +1 -1
- package/lib/Module.js +1 -3
- package/lib/MultiCompiler.js +1 -1
- package/lib/MultiWatching.js +1 -1
- package/lib/NormalModule.js +6 -4
- package/lib/NormalModuleFactory.js +25 -27
- package/lib/ProgressPlugin.js +1 -1
- package/lib/RawModule.js +1 -1
- package/lib/RuntimeGlobals.js +18 -0
- package/lib/RuntimeModule.js +1 -1
- package/lib/RuntimePlugin.js +28 -3
- package/lib/RuntimeTemplate.js +1 -1
- package/lib/TemplatedPathPlugin.js +48 -23
- package/lib/Watching.js +1 -1
- package/lib/WebpackOptionsApply.js +1 -1
- package/lib/asset/AssetGenerator.js +65 -26
- package/lib/asset/AssetModulesPlugin.js +3 -0
- package/lib/asset/RawDataUrlModule.js +8 -5
- package/lib/async-modules/AwaitDependenciesInitFragment.js +4 -4
- package/lib/buildChunkGraph.js +1 -1
- package/lib/cache/ResolverCachePlugin.js +1 -1
- package/lib/cli.js +44 -3
- package/lib/config/defaults.js +30 -7
- package/lib/config/normalization.js +5 -0
- package/lib/container/ContainerEntryModule.js +4 -2
- package/lib/container/FallbackModule.js +4 -4
- package/lib/container/RemoteModule.js +4 -2
- package/lib/css/CssExportsGenerator.js +139 -0
- package/lib/css/CssGenerator.js +3 -0
- package/lib/css/CssLoadingRuntimeModule.js +201 -154
- package/lib/css/CssModulesPlugin.js +22 -4
- package/lib/debug/ProfilingPlugin.js +15 -14
- package/lib/dependencies/ContextElementDependency.js +8 -2
- package/lib/dependencies/CreateScriptUrlDependency.js +12 -0
- package/lib/dependencies/ExportsInfoDependency.js +6 -0
- package/lib/dependencies/HarmonyCompatibilityDependency.js +5 -5
- package/lib/dependencies/ImportMetaPlugin.js +22 -3
- package/lib/dependencies/LoaderPlugin.js +2 -2
- package/lib/hmr/LazyCompilationPlugin.js +45 -21
- package/lib/hmr/lazyCompilationBackend.js +1 -1
- package/lib/ids/DeterministicModuleIdsPlugin.js +55 -35
- package/lib/ids/HashedModuleIdsPlugin.js +9 -12
- package/lib/ids/IdHelpers.js +24 -10
- package/lib/ids/NamedModuleIdsPlugin.js +6 -9
- package/lib/ids/NaturalModuleIdsPlugin.js +10 -13
- package/lib/ids/OccurrenceModuleIdsPlugin.js +13 -10
- package/lib/ids/SyncModuleIdsPlugin.js +140 -0
- package/lib/index.js +10 -0
- package/lib/javascript/JavascriptModulesPlugin.js +27 -2
- package/lib/javascript/StartupHelpers.js +3 -2
- package/lib/library/AssignLibraryPlugin.js +8 -2
- package/lib/node/NodeTargetPlugin.js +1 -0
- package/lib/optimize/ConcatenatedModule.js +11 -5
- package/lib/runtime/AsyncModuleRuntimeModule.js +25 -15
- package/lib/runtime/CreateScriptRuntimeModule.js +36 -0
- package/lib/runtime/CreateScriptUrlRuntimeModule.js +9 -34
- package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +76 -0
- package/lib/schemes/HttpUriPlugin.js +32 -11
- package/lib/serialization/FileMiddleware.js +44 -9
- package/lib/sharing/ConsumeSharedModule.js +4 -2
- package/lib/sharing/ProvideSharedModule.js +4 -2
- package/lib/sharing/utils.js +1 -1
- package/lib/stats/DefaultStatsFactoryPlugin.js +112 -67
- package/lib/stats/DefaultStatsPrinterPlugin.js +88 -23
- package/lib/util/ArrayHelpers.js +18 -4
- package/lib/util/AsyncQueue.js +1 -1
- package/lib/util/compileBooleanMatcher.js +1 -1
- package/lib/util/deterministicGrouping.js +1 -1
- package/lib/util/identifier.js +65 -44
- package/lib/util/nonNumericOnlyHash.js +22 -0
- package/lib/util/semver.js +17 -10
- package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +9 -3
- package/lib/webworker/ImportScriptsChunkLoadingPlugin.js +3 -11
- package/package.json +14 -21
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +47 -6
- package/schemas/plugins/asset/AssetGeneratorOptions.check.js +1 -1
- package/schemas/plugins/asset/AssetResourceGeneratorOptions.check.js +1 -1
- package/types.d.ts +207 -60
package/types.d.ts
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
* Run `yarn special-lint-fix` to update
|
5
5
|
*/
|
6
6
|
|
7
|
+
import { Buffer } from "buffer";
|
7
8
|
import {
|
8
9
|
ArrayExpression,
|
9
10
|
ArrayPattern,
|
@@ -63,6 +64,7 @@ import {
|
|
63
64
|
SimpleCallExpression,
|
64
65
|
SimpleLiteral,
|
65
66
|
SpreadElement,
|
67
|
+
StaticBlock,
|
66
68
|
Super,
|
67
69
|
SwitchCase,
|
68
70
|
SwitchStatement,
|
@@ -215,6 +217,7 @@ declare interface Argument {
|
|
215
217
|
}
|
216
218
|
declare interface ArgumentConfig {
|
217
219
|
description: string;
|
220
|
+
negatedDescription?: string;
|
218
221
|
path: string;
|
219
222
|
multiple: boolean;
|
220
223
|
type: "string" | "number" | "boolean" | "path" | "enum" | "RegExp" | "reset";
|
@@ -320,6 +323,11 @@ declare interface AssetResourceGeneratorOptions {
|
|
320
323
|
*/
|
321
324
|
filename?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
322
325
|
|
326
|
+
/**
|
327
|
+
* 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.
|
328
|
+
*/
|
329
|
+
outputPath?: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
330
|
+
|
323
331
|
/**
|
324
332
|
* The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
|
325
333
|
*/
|
@@ -656,7 +664,7 @@ declare interface CacheGroupsContext {
|
|
656
664
|
moduleGraph: ModuleGraph;
|
657
665
|
chunkGraph: ChunkGraph;
|
658
666
|
}
|
659
|
-
type CacheOptionsNormalized = false |
|
667
|
+
type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
|
660
668
|
declare class CachedSource extends Source {
|
661
669
|
constructor(source: Source);
|
662
670
|
constructor(source: Source | (() => Source), cachedData?: any);
|
@@ -675,16 +683,16 @@ declare interface CallExpressionInfo {
|
|
675
683
|
getMembers: () => string[];
|
676
684
|
}
|
677
685
|
declare interface CallbackAsyncQueue<T> {
|
678
|
-
(err?: WebpackError, result?: T): any;
|
686
|
+
(err?: null | WebpackError, result?: T): any;
|
679
687
|
}
|
680
688
|
declare interface CallbackCache<T> {
|
681
|
-
(err?: WebpackError, result?: T): void;
|
689
|
+
(err?: null | WebpackError, result?: T): void;
|
682
690
|
}
|
683
691
|
declare interface CallbackFunction<T> {
|
684
|
-
(err?: Error, result?: T): any;
|
692
|
+
(err?: null | Error, result?: T): any;
|
685
693
|
}
|
686
694
|
declare interface CallbackNormalErrorCache<T> {
|
687
|
-
(err?: Error, result?: T): void;
|
695
|
+
(err?: null | Error, result?: T): void;
|
688
696
|
}
|
689
697
|
declare interface CallbackWebpack<T> {
|
690
698
|
(err?: Error, stats?: T): void;
|
@@ -1041,6 +1049,11 @@ declare abstract class ChunkGroup {
|
|
1041
1049
|
}
|
1042
1050
|
type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
|
1043
1051
|
declare interface ChunkHashContext {
|
1052
|
+
/**
|
1053
|
+
* results of code generation
|
1054
|
+
*/
|
1055
|
+
codeGenerationResults: CodeGenerationResults;
|
1056
|
+
|
1044
1057
|
/**
|
1045
1058
|
* the runtime template
|
1046
1059
|
*/
|
@@ -1541,7 +1554,7 @@ declare class Compilation {
|
|
1541
1554
|
getLogger(name: string | (() => string)): WebpackLogger;
|
1542
1555
|
addModule(
|
1543
1556
|
module: Module,
|
1544
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1557
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1545
1558
|
): void;
|
1546
1559
|
|
1547
1560
|
/**
|
@@ -1559,21 +1572,21 @@ declare class Compilation {
|
|
1559
1572
|
*/
|
1560
1573
|
buildModule(
|
1561
1574
|
module: Module,
|
1562
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1575
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1563
1576
|
): void;
|
1564
1577
|
processModuleDependencies(
|
1565
1578
|
module: Module,
|
1566
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1579
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1567
1580
|
): void;
|
1568
1581
|
processModuleDependenciesNonRecursive(module: Module): void;
|
1569
1582
|
handleModuleCreation(
|
1570
1583
|
__0: HandleModuleCreationOptions,
|
1571
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1584
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1572
1585
|
): void;
|
1573
1586
|
addModuleChain(
|
1574
1587
|
context: string,
|
1575
1588
|
dependency: Dependency,
|
1576
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1589
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1577
1590
|
): void;
|
1578
1591
|
addModuleTree(
|
1579
1592
|
__0: {
|
@@ -1590,27 +1603,27 @@ declare class Compilation {
|
|
1590
1603
|
*/
|
1591
1604
|
contextInfo?: Partial<ModuleFactoryCreateDataContextInfo>;
|
1592
1605
|
},
|
1593
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1606
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1594
1607
|
): void;
|
1595
1608
|
addEntry(
|
1596
1609
|
context: string,
|
1597
1610
|
entry: Dependency,
|
1598
1611
|
optionsOrName: string | EntryOptions,
|
1599
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1612
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1600
1613
|
): void;
|
1601
1614
|
addInclude(
|
1602
1615
|
context: string,
|
1603
1616
|
dependency: Dependency,
|
1604
1617
|
options: EntryOptions,
|
1605
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1618
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1606
1619
|
): void;
|
1607
1620
|
rebuildModule(
|
1608
1621
|
module: Module,
|
1609
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1622
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1610
1623
|
): void;
|
1611
1624
|
finish(callback?: any): void;
|
1612
1625
|
unseal(): void;
|
1613
|
-
seal(callback: (err?: WebpackError) => void): void;
|
1626
|
+
seal(callback: (err?: null | WebpackError) => void): void;
|
1614
1627
|
reportDependencyErrorsAndWarnings(
|
1615
1628
|
module: Module,
|
1616
1629
|
blocks: DependenciesBlock[]
|
@@ -1643,11 +1656,15 @@ declare class Compilation {
|
|
1643
1656
|
module: RuntimeModule,
|
1644
1657
|
chunkGraph?: ChunkGraph
|
1645
1658
|
): void;
|
1659
|
+
|
1660
|
+
/**
|
1661
|
+
* If `module` is passed, `loc` and `request` must also be passed.
|
1662
|
+
*/
|
1646
1663
|
addChunkInGroup(
|
1647
1664
|
groupOptions: string | ChunkGroupOptions,
|
1648
|
-
module
|
1649
|
-
loc
|
1650
|
-
request
|
1665
|
+
module?: Module,
|
1666
|
+
loc?: SyntheticDependencyLocation | RealDependencyLocation,
|
1667
|
+
request?: string
|
1651
1668
|
): ChunkGroup;
|
1652
1669
|
addAsyncEntrypoint(
|
1653
1670
|
options: EntryOptions,
|
@@ -1698,7 +1715,7 @@ declare class Compilation {
|
|
1698
1715
|
clearAssets(): void;
|
1699
1716
|
createModuleAssets(): void;
|
1700
1717
|
getRenderManifest(options: RenderManifestOptions): RenderManifestEntry[];
|
1701
|
-
createChunkAssets(callback: (err?: WebpackError) => void): void;
|
1718
|
+
createChunkAssets(callback: (err?: null | WebpackError) => void): void;
|
1702
1719
|
getPath(
|
1703
1720
|
filename: string | ((arg0: PathData, arg1?: AssetInfo) => string),
|
1704
1721
|
data?: PathData
|
@@ -1734,17 +1751,20 @@ declare class Compilation {
|
|
1734
1751
|
executeModule(
|
1735
1752
|
module: Module,
|
1736
1753
|
options: ExecuteModuleOptions,
|
1737
|
-
callback: (err?: WebpackError, result?: ExecuteModuleResult) => void
|
1754
|
+
callback: (err?: null | WebpackError, result?: ExecuteModuleResult) => void
|
1738
1755
|
): void;
|
1739
1756
|
checkConstraints(): void;
|
1740
1757
|
factorizeModule: {
|
1741
1758
|
(
|
1742
1759
|
options: FactorizeModuleOptions & { factoryResult?: false },
|
1743
|
-
callback: (err?: WebpackError, result?: Module) => void
|
1760
|
+
callback: (err?: null | WebpackError, result?: Module) => void
|
1744
1761
|
): void;
|
1745
1762
|
(
|
1746
1763
|
options: FactorizeModuleOptions & { factoryResult: true },
|
1747
|
-
callback: (
|
1764
|
+
callback: (
|
1765
|
+
err?: null | WebpackError,
|
1766
|
+
result?: ModuleFactoryResult
|
1767
|
+
) => void
|
1748
1768
|
): void;
|
1749
1769
|
};
|
1750
1770
|
|
@@ -1887,6 +1907,8 @@ declare class Compiler {
|
|
1887
1907
|
make: AsyncParallelHook<[Compilation]>;
|
1888
1908
|
finishMake: AsyncParallelHook<[Compilation]>;
|
1889
1909
|
afterCompile: AsyncSeriesHook<[Compilation]>;
|
1910
|
+
readRecords: AsyncSeriesHook<[]>;
|
1911
|
+
emitRecords: AsyncSeriesHook<[]>;
|
1890
1912
|
watchRun: AsyncSeriesHook<[Compiler]>;
|
1891
1913
|
failed: SyncHook<[Error]>;
|
1892
1914
|
invalid: SyncHook<[null | string, number]>;
|
@@ -1942,7 +1964,11 @@ declare class Compiler {
|
|
1942
1964
|
watch(watchOptions: WatchOptions, handler: CallbackFunction<Stats>): Watching;
|
1943
1965
|
run(callback: CallbackFunction<Stats>): void;
|
1944
1966
|
runAsChild(
|
1945
|
-
callback: (
|
1967
|
+
callback: (
|
1968
|
+
err?: null | Error,
|
1969
|
+
entries?: Chunk[],
|
1970
|
+
compilation?: Compilation
|
1971
|
+
) => any
|
1946
1972
|
): void;
|
1947
1973
|
purgeInputFileSystem(): void;
|
1948
1974
|
emitAssets(compilation: Compilation, callback: CallbackFunction<void>): void;
|
@@ -2037,7 +2063,7 @@ declare interface Configuration {
|
|
2037
2063
|
/**
|
2038
2064
|
* Cache generated modules and chunks to improve performance for multiple incremental builds.
|
2039
2065
|
*/
|
2040
|
-
cache?: boolean |
|
2066
|
+
cache?: boolean | FileCacheOptions | MemoryCacheOptions;
|
2041
2067
|
|
2042
2068
|
/**
|
2043
2069
|
* The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
|
@@ -2094,6 +2120,7 @@ declare interface Configuration {
|
|
2094
2120
|
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
|
2095
2121
|
*/
|
2096
2122
|
externalsType?:
|
2123
|
+
| "import"
|
2097
2124
|
| "var"
|
2098
2125
|
| "module"
|
2099
2126
|
| "assign"
|
@@ -2112,7 +2139,6 @@ declare interface Configuration {
|
|
2112
2139
|
| "jsonp"
|
2113
2140
|
| "system"
|
2114
2141
|
| "promise"
|
2115
|
-
| "import"
|
2116
2142
|
| "script"
|
2117
2143
|
| "node-commonjs";
|
2118
2144
|
|
@@ -2451,9 +2477,9 @@ declare interface ContextHash {
|
|
2451
2477
|
symlinks?: Set<string>;
|
2452
2478
|
}
|
2453
2479
|
type ContextMode =
|
2480
|
+
| "weak"
|
2454
2481
|
| "sync"
|
2455
2482
|
| "eager"
|
2456
|
-
| "weak"
|
2457
2483
|
| "async-weak"
|
2458
2484
|
| "lazy"
|
2459
2485
|
| "lazy-once";
|
@@ -2476,7 +2502,10 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
|
|
2476
2502
|
resolveDependencies(
|
2477
2503
|
fs: InputFileSystem,
|
2478
2504
|
options: ContextModuleOptions,
|
2479
|
-
callback: (
|
2505
|
+
callback: (
|
2506
|
+
err?: null | Error,
|
2507
|
+
dependencies?: ContextElementDependency[]
|
2508
|
+
) => any
|
2480
2509
|
): void;
|
2481
2510
|
}
|
2482
2511
|
|
@@ -2526,6 +2555,16 @@ declare interface ContextTimestampAndHash {
|
|
2526
2555
|
}
|
2527
2556
|
type CreateStatsOptionsContext = KnownCreateStatsOptionsContext &
|
2528
2557
|
Record<string, any>;
|
2558
|
+
|
2559
|
+
/**
|
2560
|
+
* Options for css handling.
|
2561
|
+
*/
|
2562
|
+
declare interface CssExperimentOptions {
|
2563
|
+
/**
|
2564
|
+
* Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
|
2565
|
+
*/
|
2566
|
+
exportsOnly?: boolean;
|
2567
|
+
}
|
2529
2568
|
type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
|
2530
2569
|
declare class DefinePlugin {
|
2531
2570
|
/**
|
@@ -2739,8 +2778,58 @@ declare class DeterministicChunkIdsPlugin {
|
|
2739
2778
|
apply(compiler: Compiler): void;
|
2740
2779
|
}
|
2741
2780
|
declare class DeterministicModuleIdsPlugin {
|
2742
|
-
constructor(options?:
|
2743
|
-
|
2781
|
+
constructor(options?: {
|
2782
|
+
/**
|
2783
|
+
* context relative to which module identifiers are computed
|
2784
|
+
*/
|
2785
|
+
context?: string;
|
2786
|
+
/**
|
2787
|
+
* selector function for modules
|
2788
|
+
*/
|
2789
|
+
test?: (arg0: Module) => boolean;
|
2790
|
+
/**
|
2791
|
+
* maximum id length in digits (used as starting point)
|
2792
|
+
*/
|
2793
|
+
maxLength?: number;
|
2794
|
+
/**
|
2795
|
+
* hash salt for ids
|
2796
|
+
*/
|
2797
|
+
salt?: number;
|
2798
|
+
/**
|
2799
|
+
* do not increase the maxLength to find an optimal id space size
|
2800
|
+
*/
|
2801
|
+
fixedLength?: boolean;
|
2802
|
+
/**
|
2803
|
+
* throw an error when id conflicts occur (instead of rehashing)
|
2804
|
+
*/
|
2805
|
+
failOnConflict?: boolean;
|
2806
|
+
});
|
2807
|
+
options: {
|
2808
|
+
/**
|
2809
|
+
* context relative to which module identifiers are computed
|
2810
|
+
*/
|
2811
|
+
context?: string;
|
2812
|
+
/**
|
2813
|
+
* selector function for modules
|
2814
|
+
*/
|
2815
|
+
test?: (arg0: Module) => boolean;
|
2816
|
+
/**
|
2817
|
+
* maximum id length in digits (used as starting point)
|
2818
|
+
*/
|
2819
|
+
maxLength?: number;
|
2820
|
+
/**
|
2821
|
+
* hash salt for ids
|
2822
|
+
*/
|
2823
|
+
salt?: number;
|
2824
|
+
/**
|
2825
|
+
* do not increase the maxLength to find an optimal id space size
|
2826
|
+
*/
|
2827
|
+
fixedLength?: boolean;
|
2828
|
+
/**
|
2829
|
+
* throw an error when id conflicts occur (instead of rehashing)
|
2830
|
+
*/
|
2831
|
+
failOnConflict?: boolean;
|
2832
|
+
};
|
2744
2833
|
|
2745
2834
|
/**
|
2746
2835
|
* Apply the plugin
|
@@ -3359,11 +3448,6 @@ declare interface ExperimentsCommon {
|
|
3359
3448
|
*/
|
3360
3449
|
cacheUnaffected?: boolean;
|
3361
3450
|
|
3362
|
-
/**
|
3363
|
-
* Enable css support.
|
3364
|
-
*/
|
3365
|
-
css?: boolean;
|
3366
|
-
|
3367
3451
|
/**
|
3368
3452
|
* Apply defaults of next major version.
|
3369
3453
|
*/
|
@@ -3399,6 +3483,11 @@ declare interface ExperimentsExtra {
|
|
3399
3483
|
*/
|
3400
3484
|
buildHttp?: HttpUriOptions | (string | RegExp | ((uri: string) => boolean))[];
|
3401
3485
|
|
3486
|
+
/**
|
3487
|
+
* Enable css support.
|
3488
|
+
*/
|
3489
|
+
css?: boolean | CssExperimentOptions;
|
3490
|
+
|
3402
3491
|
/**
|
3403
3492
|
* Compile entrypoints and import()s only when they are accessed.
|
3404
3493
|
*/
|
@@ -3415,6 +3504,11 @@ declare interface ExperimentsNormalizedExtra {
|
|
3415
3504
|
*/
|
3416
3505
|
buildHttp?: HttpUriOptions;
|
3417
3506
|
|
3507
|
+
/**
|
3508
|
+
* Enable css support.
|
3509
|
+
*/
|
3510
|
+
css?: CssExperimentOptions;
|
3511
|
+
|
3418
3512
|
/**
|
3419
3513
|
* Compile entrypoints and import()s only when they are accessed.
|
3420
3514
|
*/
|
@@ -3869,6 +3963,7 @@ declare interface ExternalsPresets {
|
|
3869
3963
|
webAsync?: boolean;
|
3870
3964
|
}
|
3871
3965
|
type ExternalsType =
|
3966
|
+
| "import"
|
3872
3967
|
| "var"
|
3873
3968
|
| "module"
|
3874
3969
|
| "assign"
|
@@ -3887,7 +3982,6 @@ type ExternalsType =
|
|
3887
3982
|
| "jsonp"
|
3888
3983
|
| "system"
|
3889
3984
|
| "promise"
|
3890
|
-
| "import"
|
3891
3985
|
| "script"
|
3892
3986
|
| "node-commonjs";
|
3893
3987
|
declare interface FactorizeModuleOptions {
|
@@ -4119,40 +4213,43 @@ declare abstract class FileSystemInfo {
|
|
4119
4213
|
getFileTimestamp(
|
4120
4214
|
path: string,
|
4121
4215
|
callback: (
|
4122
|
-
arg0?: WebpackError,
|
4216
|
+
arg0?: null | WebpackError,
|
4123
4217
|
arg1?: null | FileSystemInfoEntry | "ignore"
|
4124
4218
|
) => void
|
4125
4219
|
): void;
|
4126
4220
|
getContextTimestamp(
|
4127
4221
|
path: string,
|
4128
4222
|
callback: (
|
4129
|
-
arg0?: WebpackError,
|
4223
|
+
arg0?: null | WebpackError,
|
4130
4224
|
arg1?: null | "ignore" | ResolvedContextFileSystemInfoEntry
|
4131
4225
|
) => void
|
4132
4226
|
): void;
|
4133
4227
|
getFileHash(
|
4134
4228
|
path: string,
|
4135
|
-
callback: (arg0?: WebpackError, arg1?: string) => void
|
4229
|
+
callback: (arg0?: null | WebpackError, arg1?: string) => void
|
4136
4230
|
): void;
|
4137
4231
|
getContextHash(
|
4138
4232
|
path: string,
|
4139
|
-
callback: (arg0?: WebpackError, arg1?: string) => void
|
4233
|
+
callback: (arg0?: null | WebpackError, arg1?: string) => void
|
4140
4234
|
): void;
|
4141
4235
|
getContextTsh(
|
4142
4236
|
path: string,
|
4143
4237
|
callback: (
|
4144
|
-
arg0?: WebpackError,
|
4238
|
+
arg0?: null | WebpackError,
|
4145
4239
|
arg1?: ResolvedContextTimestampAndHash
|
4146
4240
|
) => void
|
4147
4241
|
): void;
|
4148
4242
|
resolveBuildDependencies(
|
4149
4243
|
context: string,
|
4150
4244
|
deps: Iterable<string>,
|
4151
|
-
callback: (
|
4245
|
+
callback: (
|
4246
|
+
arg0?: null | Error,
|
4247
|
+
arg1?: ResolveBuildDependenciesResult
|
4248
|
+
) => void
|
4152
4249
|
): void;
|
4153
4250
|
checkResolveResultsValid(
|
4154
4251
|
resolveResults: Map<string, string | false>,
|
4155
|
-
callback: (arg0?: Error, arg1?: boolean) => void
|
4252
|
+
callback: (arg0?: null | Error, arg1?: boolean) => void
|
4156
4253
|
): void;
|
4157
4254
|
createSnapshot(
|
4158
4255
|
startTime: number,
|
@@ -4169,12 +4266,12 @@ declare abstract class FileSystemInfo {
|
|
4169
4266
|
*/
|
4170
4267
|
timestamp?: boolean;
|
4171
4268
|
},
|
4172
|
-
callback: (arg0?: WebpackError, arg1?: Snapshot) => void
|
4269
|
+
callback: (arg0?: null | WebpackError, arg1?: null | Snapshot) => void
|
4173
4270
|
): void;
|
4174
4271
|
mergeSnapshots(snapshot1: Snapshot, snapshot2: Snapshot): Snapshot;
|
4175
4272
|
checkSnapshotValid(
|
4176
4273
|
snapshot: Snapshot,
|
4177
|
-
callback: (arg0?: WebpackError, arg1?: boolean) => void
|
4274
|
+
callback: (arg0?: null | WebpackError, arg1?: boolean) => void
|
4178
4275
|
): void;
|
4179
4276
|
getDeprecatedFileTimestamps(): Map<any, any>;
|
4180
4277
|
getDeprecatedContextTimestamps(): Map<any, any>;
|
@@ -4372,12 +4469,12 @@ declare class Hash {
|
|
4372
4469
|
constructor();
|
4373
4470
|
|
4374
4471
|
/**
|
4375
|
-
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
|
4472
|
+
* Update hash {@link https ://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
|
4376
4473
|
*/
|
4377
4474
|
update(data: string | Buffer, inputEncoding?: string): Hash;
|
4378
4475
|
|
4379
4476
|
/**
|
4380
|
-
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
|
4477
|
+
* Calculates the digest {@link https ://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
|
4381
4478
|
*/
|
4382
4479
|
digest(encoding?: string): string | Buffer;
|
4383
4480
|
}
|
@@ -4398,7 +4495,7 @@ declare interface HashedModuleIdsPluginOptions {
|
|
4398
4495
|
/**
|
4399
4496
|
* The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
|
4400
4497
|
*/
|
4401
|
-
hashDigest?: "
|
4498
|
+
hashDigest?: "latin1" | "hex" | "base64";
|
4402
4499
|
|
4403
4500
|
/**
|
4404
4501
|
* The prefix length of the hash digest to use, defaults to 4.
|
@@ -4812,6 +4909,7 @@ declare class JavascriptParser extends Parser {
|
|
4812
4909
|
| ClassDeclaration
|
4813
4910
|
| ExpressionStatement
|
4814
4911
|
| BlockStatement
|
4912
|
+
| StaticBlock
|
4815
4913
|
| EmptyStatement
|
4816
4914
|
| DebuggerStatement
|
4817
4915
|
| WithStatement
|
@@ -4842,6 +4940,7 @@ declare class JavascriptParser extends Parser {
|
|
4842
4940
|
| ClassDeclaration
|
4843
4941
|
| ExpressionStatement
|
4844
4942
|
| BlockStatement
|
4943
|
+
| StaticBlock
|
4845
4944
|
| EmptyStatement
|
4846
4945
|
| DebuggerStatement
|
4847
4946
|
| WithStatement
|
@@ -4872,6 +4971,7 @@ declare class JavascriptParser extends Parser {
|
|
4872
4971
|
| ClassDeclaration
|
4873
4972
|
| ExpressionStatement
|
4874
4973
|
| BlockStatement
|
4974
|
+
| StaticBlock
|
4875
4975
|
| EmptyStatement
|
4876
4976
|
| DebuggerStatement
|
4877
4977
|
| WithStatement
|
@@ -5043,6 +5143,7 @@ declare class JavascriptParser extends Parser {
|
|
5043
5143
|
| ClassDeclaration
|
5044
5144
|
| ExpressionStatement
|
5045
5145
|
| BlockStatement
|
5146
|
+
| StaticBlock
|
5046
5147
|
| EmptyStatement
|
5047
5148
|
| DebuggerStatement
|
5048
5149
|
| WithStatement
|
@@ -5265,7 +5366,7 @@ declare class JavascriptParser extends Parser {
|
|
5265
5366
|
setVariable(name: string, variableInfo: ExportedVariableInfo): void;
|
5266
5367
|
parseCommentOptions(
|
5267
5368
|
range?: any
|
5268
|
-
): { options: null; errors: null } | { options: object; errors:
|
5369
|
+
): { options: null; errors: null } | { options: object; errors: unknown[] };
|
5269
5370
|
extractMemberExpressionChain(expression: MemberExpression): {
|
5270
5371
|
members: string[];
|
5271
5372
|
object:
|
@@ -5382,6 +5483,11 @@ declare interface JavascriptParserOptions {
|
|
5382
5483
|
*/
|
5383
5484
|
importExportsPresence?: false | "auto" | "error" | "warn";
|
5384
5485
|
|
5486
|
+
/**
|
5487
|
+
* Enable/disable evaluating import.meta.
|
5488
|
+
*/
|
5489
|
+
importMeta?: boolean;
|
5490
|
+
|
5385
5491
|
/**
|
5386
5492
|
* Include polyfills or mocks for various node stuff.
|
5387
5493
|
*/
|
@@ -5939,9 +6045,8 @@ declare class LazySet<T> {
|
|
5939
6045
|
has(item: T): boolean;
|
5940
6046
|
keys(): IterableIterator<T>;
|
5941
6047
|
values(): IterableIterator<T>;
|
5942
|
-
[Symbol.iterator](): IterableIterator<T>;
|
5943
|
-
readonly [Symbol.toStringTag]: string;
|
5944
6048
|
serialize(__0: { write: any }): void;
|
6049
|
+
[Symbol.iterator](): IterableIterator<T>;
|
5945
6050
|
static deserialize(__0: { read: any }): LazySet<any>;
|
5946
6051
|
}
|
5947
6052
|
declare interface LibIdentOptions {
|
@@ -6219,7 +6324,7 @@ declare interface LoaderPluginLoaderContext {
|
|
6219
6324
|
importModule(
|
6220
6325
|
request: string,
|
6221
6326
|
options: ImportModuleOptions,
|
6222
|
-
callback: (err?: Error, exports?: any) => any
|
6327
|
+
callback: (err?: null | Error, exports?: any) => any
|
6223
6328
|
): void;
|
6224
6329
|
importModule(request: string, options?: ImportModuleOptions): Promise<any>;
|
6225
6330
|
}
|
@@ -6585,7 +6690,7 @@ declare class Module extends DependenciesBlock {
|
|
6585
6690
|
hasReasons(moduleGraph: ModuleGraph, runtime: RuntimeSpec): boolean;
|
6586
6691
|
needBuild(
|
6587
6692
|
context: NeedBuildContext,
|
6588
|
-
callback: (arg0?: WebpackError, arg1?: boolean) => void
|
6693
|
+
callback: (arg0?: null | WebpackError, arg1?: boolean) => void
|
6589
6694
|
): void;
|
6590
6695
|
needRebuild(
|
6591
6696
|
fileTimestamps: Map<string, null | number>,
|
@@ -6732,6 +6837,7 @@ declare interface ModuleFederationPluginOptions {
|
|
6732
6837
|
* The external type of the remote containers.
|
6733
6838
|
*/
|
6734
6839
|
remoteType?:
|
6840
|
+
| "import"
|
6735
6841
|
| "var"
|
6736
6842
|
| "module"
|
6737
6843
|
| "assign"
|
@@ -6750,7 +6856,6 @@ declare interface ModuleFederationPluginOptions {
|
|
6750
6856
|
| "jsonp"
|
6751
6857
|
| "system"
|
6752
6858
|
| "promise"
|
6753
|
-
| "import"
|
6754
6859
|
| "script"
|
6755
6860
|
| "node-commonjs";
|
6756
6861
|
|
@@ -7295,6 +7400,7 @@ type NodeEstreeIndex =
|
|
7295
7400
|
| PrivateIdentifier
|
7296
7401
|
| ExpressionStatement
|
7297
7402
|
| BlockStatement
|
7403
|
+
| StaticBlock
|
7298
7404
|
| EmptyStatement
|
7299
7405
|
| DebuggerStatement
|
7300
7406
|
| WithStatement
|
@@ -7455,7 +7561,7 @@ declare class NormalModule extends Module {
|
|
7455
7561
|
resourceResolveData?: Record<string, any>;
|
7456
7562
|
matchResource?: string;
|
7457
7563
|
loaders: LoaderItem[];
|
7458
|
-
error?: WebpackError;
|
7564
|
+
error?: null | WebpackError;
|
7459
7565
|
restoreFromUnsafeCache(
|
7460
7566
|
unsafeCacheData?: any,
|
7461
7567
|
normalModuleFactory?: any
|
@@ -7614,8 +7720,8 @@ type NormalizedStatsOptions = KnownNormalizedStatsOptions &
|
|
7614
7720
|
Omit<
|
7615
7721
|
StatsOptions,
|
7616
7722
|
| "context"
|
7617
|
-
| "requestShortener"
|
7618
7723
|
| "chunkGroups"
|
7724
|
+
| "requestShortener"
|
7619
7725
|
| "chunksSort"
|
7620
7726
|
| "modulesSort"
|
7621
7727
|
| "chunkModulesSort"
|
@@ -8892,7 +8998,7 @@ declare class ProgressPlugin {
|
|
8892
8998
|
showModules?: boolean;
|
8893
8999
|
showDependencies?: boolean;
|
8894
9000
|
showActiveModules?: boolean;
|
8895
|
-
percentBy?: null | "
|
9001
|
+
percentBy?: null | "modules" | "dependencies" | "entries";
|
8896
9002
|
apply(compiler: Compiler | MultiCompiler): void;
|
8897
9003
|
static getReporter(
|
8898
9004
|
compiler: Compiler
|
@@ -8953,7 +9059,7 @@ declare interface ProgressPluginOptions {
|
|
8953
9059
|
/**
|
8954
9060
|
* Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
|
8955
9061
|
*/
|
8956
|
-
percentBy?: null | "
|
9062
|
+
percentBy?: null | "modules" | "dependencies" | "entries";
|
8957
9063
|
|
8958
9064
|
/**
|
8959
9065
|
* Collect profile data for progress steps. Default: false.
|
@@ -9120,6 +9226,11 @@ declare interface RenderBootstrapContext {
|
|
9120
9226
|
*/
|
9121
9227
|
chunk: Chunk;
|
9122
9228
|
|
9229
|
+
/**
|
9230
|
+
* results of code generation
|
9231
|
+
*/
|
9232
|
+
codeGenerationResults: CodeGenerationResults;
|
9233
|
+
|
9123
9234
|
/**
|
9124
9235
|
* the runtime template
|
9125
9236
|
*/
|
@@ -10078,8 +10189,8 @@ declare class RuntimeSpecSet {
|
|
10078
10189
|
constructor(iterable?: any);
|
10079
10190
|
add(runtime?: any): void;
|
10080
10191
|
has(runtime?: any): boolean;
|
10081
|
-
[Symbol.iterator](): IterableIterator<RuntimeSpec>;
|
10082
10192
|
readonly size: number;
|
10193
|
+
[Symbol.iterator](): IterableIterator<RuntimeSpec>;
|
10083
10194
|
}
|
10084
10195
|
declare abstract class RuntimeTemplate {
|
10085
10196
|
compilation: Compilation;
|
@@ -10776,7 +10887,6 @@ declare abstract class SortableSet<T> extends Set<T> {
|
|
10776
10887
|
* Iterates over values in the set.
|
10777
10888
|
*/
|
10778
10889
|
[Symbol.iterator](): IterableIterator<T>;
|
10779
|
-
readonly [Symbol.toStringTag]: string;
|
10780
10890
|
}
|
10781
10891
|
declare class Source {
|
10782
10892
|
constructor();
|
@@ -10966,6 +11076,7 @@ type Statement =
|
|
10966
11076
|
| ClassDeclaration
|
10967
11077
|
| ExpressionStatement
|
10968
11078
|
| BlockStatement
|
11079
|
+
| StaticBlock
|
10969
11080
|
| EmptyStatement
|
10970
11081
|
| DebuggerStatement
|
10971
11082
|
| WithStatement
|
@@ -11511,6 +11622,31 @@ type StatsValue =
|
|
11511
11622
|
| "minimal"
|
11512
11623
|
| "normal"
|
11513
11624
|
| "detailed";
|
11625
|
+
declare class SyncModuleIdsPlugin {
|
11626
|
+
constructor(__0: {
|
11627
|
+
/**
|
11628
|
+
* path to file
|
11629
|
+
*/
|
11630
|
+
path: string;
|
11631
|
+
/**
|
11632
|
+
* context for module names
|
11633
|
+
*/
|
11634
|
+
context?: string;
|
11635
|
+
/**
|
11636
|
+
* selector for modules
|
11637
|
+
*/
|
11638
|
+
test: (arg0: Module) => boolean;
|
11639
|
+
/**
|
11640
|
+
* operation mode (defaults to merge)
|
11641
|
+
*/
|
11642
|
+
mode?: "read" | "create" | "merge" | "update";
|
11643
|
+
});
|
11644
|
+
|
11645
|
+
/**
|
11646
|
+
* Apply the plugin
|
11647
|
+
*/
|
11648
|
+
apply(compiler: Compiler): void;
|
11649
|
+
}
|
11514
11650
|
declare interface SyntheticDependencyLocation {
|
11515
11651
|
name: string;
|
11516
11652
|
index?: number;
|
@@ -12078,6 +12214,7 @@ declare interface WebpackOptionsNormalized {
|
|
12078
12214
|
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
|
12079
12215
|
*/
|
12080
12216
|
externalsType?:
|
12217
|
+
| "import"
|
12081
12218
|
| "var"
|
12082
12219
|
| "module"
|
12083
12220
|
| "assign"
|
@@ -12096,7 +12233,6 @@ declare interface WebpackOptionsNormalized {
|
|
12096
12233
|
| "jsonp"
|
12097
12234
|
| "system"
|
12098
12235
|
| "promise"
|
12099
|
-
| "import"
|
12100
12236
|
| "script"
|
12101
12237
|
| "node-commonjs";
|
12102
12238
|
|
@@ -12380,11 +12516,14 @@ declare namespace exports {
|
|
12380
12516
|
export let uncaughtErrorHandler: string;
|
12381
12517
|
export let scriptNonce: string;
|
12382
12518
|
export let loadScript: string;
|
12519
|
+
export let createScript: string;
|
12383
12520
|
export let createScriptUrl: string;
|
12521
|
+
export let getTrustedTypesPolicy: string;
|
12384
12522
|
export let chunkName: string;
|
12385
12523
|
export let runtimeId: string;
|
12386
12524
|
export let getChunkScriptFilename: string;
|
12387
12525
|
export let getChunkCssFilename: string;
|
12526
|
+
export let hasCssModules: string;
|
12388
12527
|
export let getChunkUpdateScriptFilename: string;
|
12389
12528
|
export let getChunkUpdateCssFilename: string;
|
12390
12529
|
export let startup: string;
|
@@ -12722,6 +12861,9 @@ declare namespace exports {
|
|
12722
12861
|
export namespace schemes {
|
12723
12862
|
export { HttpUriPlugin };
|
12724
12863
|
}
|
12864
|
+
export namespace ids {
|
12865
|
+
export { SyncModuleIdsPlugin };
|
12866
|
+
}
|
12725
12867
|
}
|
12726
12868
|
export type WebpackPluginFunction = (
|
12727
12869
|
this: Compiler,
|
@@ -12787,6 +12929,7 @@ declare namespace exports {
|
|
12787
12929
|
Entry,
|
12788
12930
|
EntryNormalized,
|
12789
12931
|
EntryObject,
|
12932
|
+
FileCacheOptions,
|
12790
12933
|
LibraryOptions,
|
12791
12934
|
ModuleOptions,
|
12792
12935
|
ResolveOptionsWebpackOptions as ResolveOptions,
|
@@ -12801,11 +12944,15 @@ declare namespace exports {
|
|
12801
12944
|
WebpackPluginInstance,
|
12802
12945
|
Asset,
|
12803
12946
|
AssetInfo,
|
12947
|
+
EntryOptions,
|
12948
|
+
AssetEmittedInfo,
|
12804
12949
|
MultiStats,
|
12805
12950
|
ParserState,
|
12806
12951
|
ResolvePluginInstance,
|
12807
12952
|
Resolver,
|
12808
12953
|
Watching,
|
12954
|
+
Argument,
|
12955
|
+
Problem,
|
12809
12956
|
StatsAsset,
|
12810
12957
|
StatsChunk,
|
12811
12958
|
StatsChunkGroup,
|