webpack 5.68.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/lib/ChunkGraph.js +1 -2
- package/lib/Compilation.js +2 -0
- package/lib/ExportsInfo.js +4 -4
- package/lib/NormalModuleFactory.js +25 -27
- package/lib/ProgressPlugin.js +1 -1
- package/lib/TemplatedPathPlugin.js +48 -23
- package/lib/asset/AssetGenerator.js +3 -2
- package/lib/buildChunkGraph.js +1 -1
- package/lib/config/defaults.js +7 -2
- package/lib/css/CssLoadingRuntimeModule.js +63 -70
- package/lib/css/CssModulesPlugin.js +2 -1
- package/lib/debug/ProfilingPlugin.js +3 -4
- package/lib/dependencies/ContextElementDependency.js +8 -2
- package/lib/dependencies/ExportsInfoDependency.js +6 -0
- package/lib/index.js +5 -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 +10 -4
- package/lib/schemes/HttpUriPlugin.js +24 -3
- package/lib/serialization/FileMiddleware.js +44 -9
- 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/package.json +12 -12
- package/types.d.ts +39 -18
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,
|
@@ -662,7 +664,7 @@ declare interface CacheGroupsContext {
|
|
662
664
|
moduleGraph: ModuleGraph;
|
663
665
|
chunkGraph: ChunkGraph;
|
664
666
|
}
|
665
|
-
type CacheOptionsNormalized = false |
|
667
|
+
type CacheOptionsNormalized = false | FileCacheOptions | MemoryCacheOptions;
|
666
668
|
declare class CachedSource extends Source {
|
667
669
|
constructor(source: Source);
|
668
670
|
constructor(source: Source | (() => Source), cachedData?: any);
|
@@ -1047,6 +1049,11 @@ declare abstract class ChunkGroup {
|
|
1047
1049
|
}
|
1048
1050
|
type ChunkGroupOptions = RawChunkGroupOptions & { name?: string };
|
1049
1051
|
declare interface ChunkHashContext {
|
1052
|
+
/**
|
1053
|
+
* results of code generation
|
1054
|
+
*/
|
1055
|
+
codeGenerationResults: CodeGenerationResults;
|
1056
|
+
|
1050
1057
|
/**
|
1051
1058
|
* the runtime template
|
1052
1059
|
*/
|
@@ -2056,7 +2063,7 @@ declare interface Configuration {
|
|
2056
2063
|
/**
|
2057
2064
|
* Cache generated modules and chunks to improve performance for multiple incremental builds.
|
2058
2065
|
*/
|
2059
|
-
cache?: boolean |
|
2066
|
+
cache?: boolean | FileCacheOptions | MemoryCacheOptions;
|
2060
2067
|
|
2061
2068
|
/**
|
2062
2069
|
* The base directory (absolute path!) for resolving the `entry` option. If `output.pathinfo` is set, the included pathinfo is shortened to this directory.
|
@@ -2113,6 +2120,7 @@ declare interface Configuration {
|
|
2113
2120
|
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
|
2114
2121
|
*/
|
2115
2122
|
externalsType?:
|
2123
|
+
| "import"
|
2116
2124
|
| "var"
|
2117
2125
|
| "module"
|
2118
2126
|
| "assign"
|
@@ -2131,7 +2139,6 @@ declare interface Configuration {
|
|
2131
2139
|
| "jsonp"
|
2132
2140
|
| "system"
|
2133
2141
|
| "promise"
|
2134
|
-
| "import"
|
2135
2142
|
| "script"
|
2136
2143
|
| "node-commonjs";
|
2137
2144
|
|
@@ -2470,9 +2477,9 @@ declare interface ContextHash {
|
|
2470
2477
|
symlinks?: Set<string>;
|
2471
2478
|
}
|
2472
2479
|
type ContextMode =
|
2480
|
+
| "weak"
|
2473
2481
|
| "sync"
|
2474
2482
|
| "eager"
|
2475
|
-
| "weak"
|
2476
2483
|
| "async-weak"
|
2477
2484
|
| "lazy"
|
2478
2485
|
| "lazy-once";
|
@@ -3956,6 +3963,7 @@ declare interface ExternalsPresets {
|
|
3956
3963
|
webAsync?: boolean;
|
3957
3964
|
}
|
3958
3965
|
type ExternalsType =
|
3966
|
+
| "import"
|
3959
3967
|
| "var"
|
3960
3968
|
| "module"
|
3961
3969
|
| "assign"
|
@@ -3974,7 +3982,6 @@ type ExternalsType =
|
|
3974
3982
|
| "jsonp"
|
3975
3983
|
| "system"
|
3976
3984
|
| "promise"
|
3977
|
-
| "import"
|
3978
3985
|
| "script"
|
3979
3986
|
| "node-commonjs";
|
3980
3987
|
declare interface FactorizeModuleOptions {
|
@@ -4462,12 +4469,12 @@ declare class Hash {
|
|
4462
4469
|
constructor();
|
4463
4470
|
|
4464
4471
|
/**
|
4465
|
-
* 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}
|
4466
4473
|
*/
|
4467
4474
|
update(data: string | Buffer, inputEncoding?: string): Hash;
|
4468
4475
|
|
4469
4476
|
/**
|
4470
|
-
* 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}
|
4471
4478
|
*/
|
4472
4479
|
digest(encoding?: string): string | Buffer;
|
4473
4480
|
}
|
@@ -4488,7 +4495,7 @@ declare interface HashedModuleIdsPluginOptions {
|
|
4488
4495
|
/**
|
4489
4496
|
* The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported.
|
4490
4497
|
*/
|
4491
|
-
hashDigest?: "
|
4498
|
+
hashDigest?: "latin1" | "hex" | "base64";
|
4492
4499
|
|
4493
4500
|
/**
|
4494
4501
|
* The prefix length of the hash digest to use, defaults to 4.
|
@@ -4902,6 +4909,7 @@ declare class JavascriptParser extends Parser {
|
|
4902
4909
|
| ClassDeclaration
|
4903
4910
|
| ExpressionStatement
|
4904
4911
|
| BlockStatement
|
4912
|
+
| StaticBlock
|
4905
4913
|
| EmptyStatement
|
4906
4914
|
| DebuggerStatement
|
4907
4915
|
| WithStatement
|
@@ -4932,6 +4940,7 @@ declare class JavascriptParser extends Parser {
|
|
4932
4940
|
| ClassDeclaration
|
4933
4941
|
| ExpressionStatement
|
4934
4942
|
| BlockStatement
|
4943
|
+
| StaticBlock
|
4935
4944
|
| EmptyStatement
|
4936
4945
|
| DebuggerStatement
|
4937
4946
|
| WithStatement
|
@@ -4962,6 +4971,7 @@ declare class JavascriptParser extends Parser {
|
|
4962
4971
|
| ClassDeclaration
|
4963
4972
|
| ExpressionStatement
|
4964
4973
|
| BlockStatement
|
4974
|
+
| StaticBlock
|
4965
4975
|
| EmptyStatement
|
4966
4976
|
| DebuggerStatement
|
4967
4977
|
| WithStatement
|
@@ -5133,6 +5143,7 @@ declare class JavascriptParser extends Parser {
|
|
5133
5143
|
| ClassDeclaration
|
5134
5144
|
| ExpressionStatement
|
5135
5145
|
| BlockStatement
|
5146
|
+
| StaticBlock
|
5136
5147
|
| EmptyStatement
|
5137
5148
|
| DebuggerStatement
|
5138
5149
|
| WithStatement
|
@@ -5355,7 +5366,7 @@ declare class JavascriptParser extends Parser {
|
|
5355
5366
|
setVariable(name: string, variableInfo: ExportedVariableInfo): void;
|
5356
5367
|
parseCommentOptions(
|
5357
5368
|
range?: any
|
5358
|
-
): { options: null; errors: null } | { options: object; errors:
|
5369
|
+
): { options: null; errors: null } | { options: object; errors: unknown[] };
|
5359
5370
|
extractMemberExpressionChain(expression: MemberExpression): {
|
5360
5371
|
members: string[];
|
5361
5372
|
object:
|
@@ -6034,9 +6045,8 @@ declare class LazySet<T> {
|
|
6034
6045
|
has(item: T): boolean;
|
6035
6046
|
keys(): IterableIterator<T>;
|
6036
6047
|
values(): IterableIterator<T>;
|
6037
|
-
[Symbol.iterator](): IterableIterator<T>;
|
6038
|
-
readonly [Symbol.toStringTag]: string;
|
6039
6048
|
serialize(__0: { write: any }): void;
|
6049
|
+
[Symbol.iterator](): IterableIterator<T>;
|
6040
6050
|
static deserialize(__0: { read: any }): LazySet<any>;
|
6041
6051
|
}
|
6042
6052
|
declare interface LibIdentOptions {
|
@@ -6827,6 +6837,7 @@ declare interface ModuleFederationPluginOptions {
|
|
6827
6837
|
* The external type of the remote containers.
|
6828
6838
|
*/
|
6829
6839
|
remoteType?:
|
6840
|
+
| "import"
|
6830
6841
|
| "var"
|
6831
6842
|
| "module"
|
6832
6843
|
| "assign"
|
@@ -6845,7 +6856,6 @@ declare interface ModuleFederationPluginOptions {
|
|
6845
6856
|
| "jsonp"
|
6846
6857
|
| "system"
|
6847
6858
|
| "promise"
|
6848
|
-
| "import"
|
6849
6859
|
| "script"
|
6850
6860
|
| "node-commonjs";
|
6851
6861
|
|
@@ -7390,6 +7400,7 @@ type NodeEstreeIndex =
|
|
7390
7400
|
| PrivateIdentifier
|
7391
7401
|
| ExpressionStatement
|
7392
7402
|
| BlockStatement
|
7403
|
+
| StaticBlock
|
7393
7404
|
| EmptyStatement
|
7394
7405
|
| DebuggerStatement
|
7395
7406
|
| WithStatement
|
@@ -7709,8 +7720,8 @@ type NormalizedStatsOptions = KnownNormalizedStatsOptions &
|
|
7709
7720
|
Omit<
|
7710
7721
|
StatsOptions,
|
7711
7722
|
| "context"
|
7712
|
-
| "requestShortener"
|
7713
7723
|
| "chunkGroups"
|
7724
|
+
| "requestShortener"
|
7714
7725
|
| "chunksSort"
|
7715
7726
|
| "modulesSort"
|
7716
7727
|
| "chunkModulesSort"
|
@@ -8987,7 +8998,7 @@ declare class ProgressPlugin {
|
|
8987
8998
|
showModules?: boolean;
|
8988
8999
|
showDependencies?: boolean;
|
8989
9000
|
showActiveModules?: boolean;
|
8990
|
-
percentBy?: null | "
|
9001
|
+
percentBy?: null | "modules" | "dependencies" | "entries";
|
8991
9002
|
apply(compiler: Compiler | MultiCompiler): void;
|
8992
9003
|
static getReporter(
|
8993
9004
|
compiler: Compiler
|
@@ -9048,7 +9059,7 @@ declare interface ProgressPluginOptions {
|
|
9048
9059
|
/**
|
9049
9060
|
* Collect percent algorithm. By default it calculates by a median from modules, entries and dependencies percent.
|
9050
9061
|
*/
|
9051
|
-
percentBy?: null | "
|
9062
|
+
percentBy?: null | "modules" | "dependencies" | "entries";
|
9052
9063
|
|
9053
9064
|
/**
|
9054
9065
|
* Collect profile data for progress steps. Default: false.
|
@@ -9215,6 +9226,11 @@ declare interface RenderBootstrapContext {
|
|
9215
9226
|
*/
|
9216
9227
|
chunk: Chunk;
|
9217
9228
|
|
9229
|
+
/**
|
9230
|
+
* results of code generation
|
9231
|
+
*/
|
9232
|
+
codeGenerationResults: CodeGenerationResults;
|
9233
|
+
|
9218
9234
|
/**
|
9219
9235
|
* the runtime template
|
9220
9236
|
*/
|
@@ -10173,8 +10189,8 @@ declare class RuntimeSpecSet {
|
|
10173
10189
|
constructor(iterable?: any);
|
10174
10190
|
add(runtime?: any): void;
|
10175
10191
|
has(runtime?: any): boolean;
|
10176
|
-
[Symbol.iterator](): IterableIterator<RuntimeSpec>;
|
10177
10192
|
readonly size: number;
|
10193
|
+
[Symbol.iterator](): IterableIterator<RuntimeSpec>;
|
10178
10194
|
}
|
10179
10195
|
declare abstract class RuntimeTemplate {
|
10180
10196
|
compilation: Compilation;
|
@@ -10871,7 +10887,6 @@ declare abstract class SortableSet<T> extends Set<T> {
|
|
10871
10887
|
* Iterates over values in the set.
|
10872
10888
|
*/
|
10873
10889
|
[Symbol.iterator](): IterableIterator<T>;
|
10874
|
-
readonly [Symbol.toStringTag]: string;
|
10875
10890
|
}
|
10876
10891
|
declare class Source {
|
10877
10892
|
constructor();
|
@@ -11061,6 +11076,7 @@ type Statement =
|
|
11061
11076
|
| ClassDeclaration
|
11062
11077
|
| ExpressionStatement
|
11063
11078
|
| BlockStatement
|
11079
|
+
| StaticBlock
|
11064
11080
|
| EmptyStatement
|
11065
11081
|
| DebuggerStatement
|
11066
11082
|
| WithStatement
|
@@ -12198,6 +12214,7 @@ declare interface WebpackOptionsNormalized {
|
|
12198
12214
|
* Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
|
12199
12215
|
*/
|
12200
12216
|
externalsType?:
|
12217
|
+
| "import"
|
12201
12218
|
| "var"
|
12202
12219
|
| "module"
|
12203
12220
|
| "assign"
|
@@ -12216,7 +12233,6 @@ declare interface WebpackOptionsNormalized {
|
|
12216
12233
|
| "jsonp"
|
12217
12234
|
| "system"
|
12218
12235
|
| "promise"
|
12219
|
-
| "import"
|
12220
12236
|
| "script"
|
12221
12237
|
| "node-commonjs";
|
12222
12238
|
|
@@ -12913,6 +12929,7 @@ declare namespace exports {
|
|
12913
12929
|
Entry,
|
12914
12930
|
EntryNormalized,
|
12915
12931
|
EntryObject,
|
12932
|
+
FileCacheOptions,
|
12916
12933
|
LibraryOptions,
|
12917
12934
|
ModuleOptions,
|
12918
12935
|
ResolveOptionsWebpackOptions as ResolveOptions,
|
@@ -12927,11 +12944,15 @@ declare namespace exports {
|
|
12927
12944
|
WebpackPluginInstance,
|
12928
12945
|
Asset,
|
12929
12946
|
AssetInfo,
|
12947
|
+
EntryOptions,
|
12948
|
+
AssetEmittedInfo,
|
12930
12949
|
MultiStats,
|
12931
12950
|
ParserState,
|
12932
12951
|
ResolvePluginInstance,
|
12933
12952
|
Resolver,
|
12934
12953
|
Watching,
|
12954
|
+
Argument,
|
12955
|
+
Problem,
|
12935
12956
|
StatsAsset,
|
12936
12957
|
StatsChunk,
|
12937
12958
|
StatsChunkGroup,
|