webpack 5.35.0 → 5.36.2
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 +113 -30
- package/lib/Compilation.js +71 -41
- package/lib/Compiler.js +25 -11
- package/lib/ContextModuleFactory.js +4 -3
- package/lib/Dependency.js +74 -4
- package/lib/FlagDependencyExportsPlugin.js +38 -37
- package/lib/InitFragment.js +21 -6
- package/lib/ModuleGraph.js +19 -53
- package/lib/NormalModuleFactory.js +27 -23
- package/lib/WebpackOptionsApply.js +1 -0
- package/lib/buildChunkGraph.js +7 -2
- package/lib/cache/PackFileCacheStrategy.js +65 -4
- package/lib/config/defaults.js +2 -1
- package/lib/config/normalization.js +1 -0
- package/lib/dependencies/HarmonyExportInitFragment.js +47 -0
- package/lib/dependencies/NullDependency.js +0 -8
- package/lib/dependencies/WorkerPlugin.js +18 -3
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +7 -0
- package/lib/javascript/JavascriptModulesPlugin.js +6 -2
- package/lib/javascript/JavascriptParser.js +39 -31
- package/lib/library/AmdLibraryPlugin.js +2 -1
- package/lib/optimize/InnerGraphPlugin.js +8 -9
- package/lib/util/AsyncQueue.js +6 -1
- package/lib/util/comparators.js +22 -16
- package/lib/util/smartGrouping.js +76 -40
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +4 -2
- package/package.json +5 -5
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +4 -0
- package/types.d.ts +101 -7
@@ -999,6 +999,10 @@
|
|
999
999
|
"description": "Name for the cache. Different names will lead to different coexisting caches.",
|
1000
1000
|
"type": "string"
|
1001
1001
|
},
|
1002
|
+
"profile": {
|
1003
|
+
"description": "Track and log detailed timing information for individual cache items.",
|
1004
|
+
"type": "boolean"
|
1005
|
+
},
|
1002
1006
|
"store": {
|
1003
1007
|
"description": "When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).",
|
1004
1008
|
"enum": ["pack"]
|
package/types.d.ts
CHANGED
@@ -60,6 +60,7 @@ import {
|
|
60
60
|
SequenceExpression,
|
61
61
|
SimpleCallExpression,
|
62
62
|
SimpleLiteral,
|
63
|
+
SourceLocation,
|
63
64
|
SpreadElement,
|
64
65
|
Super,
|
65
66
|
SwitchCase,
|
@@ -887,10 +888,15 @@ declare class ChunkGraph {
|
|
887
888
|
): ReadonlySet<string>;
|
888
889
|
getChunkRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
|
889
890
|
getModuleGraphHash(
|
890
|
-
module
|
891
|
-
runtime
|
891
|
+
module: Module,
|
892
|
+
runtime: RuntimeSpec,
|
892
893
|
withConnections?: boolean
|
893
|
-
):
|
894
|
+
): string;
|
895
|
+
getModuleGraphHashBigInt(
|
896
|
+
module: Module,
|
897
|
+
runtime: RuntimeSpec,
|
898
|
+
withConnections?: boolean
|
899
|
+
): bigint;
|
894
900
|
getTreeRuntimeRequirements(chunk: Chunk): ReadonlySet<string>;
|
895
901
|
static getChunkGraphForModule(
|
896
902
|
module: Module,
|
@@ -2457,9 +2463,9 @@ declare class Dependency {
|
|
2457
2463
|
constructor();
|
2458
2464
|
weak: boolean;
|
2459
2465
|
optional: boolean;
|
2460
|
-
loc: DependencyLocation;
|
2461
2466
|
readonly type: string;
|
2462
2467
|
readonly category: string;
|
2468
|
+
loc: DependencyLocation;
|
2463
2469
|
getResourceIdentifier(): null | string;
|
2464
2470
|
|
2465
2471
|
/**
|
@@ -3819,6 +3825,11 @@ declare interface FileCacheOptions {
|
|
3819
3825
|
*/
|
3820
3826
|
name?: string;
|
3821
3827
|
|
3828
|
+
/**
|
3829
|
+
* Track and log detailed timing information for individual cache items.
|
3830
|
+
*/
|
3831
|
+
profile?: boolean;
|
3832
|
+
|
3822
3833
|
/**
|
3823
3834
|
* When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
|
3824
3835
|
*/
|
@@ -4534,6 +4545,7 @@ declare class JavascriptParser extends Parser {
|
|
4534
4545
|
| FunctionDeclaration
|
4535
4546
|
| VariableDeclaration
|
4536
4547
|
| ClassDeclaration
|
4548
|
+
| PrivateIdentifierNode
|
4537
4549
|
),
|
4538
4550
|
number
|
4539
4551
|
],
|
@@ -4636,7 +4648,18 @@ declare class JavascriptParser extends Parser {
|
|
4636
4648
|
boolean | void
|
4637
4649
|
>;
|
4638
4650
|
classBodyElement: SyncBailHook<
|
4639
|
-
[
|
4651
|
+
[
|
4652
|
+
MethodDefinition | PropertyDefinitionNode,
|
4653
|
+
ClassExpression | ClassDeclaration
|
4654
|
+
],
|
4655
|
+
boolean | void
|
4656
|
+
>;
|
4657
|
+
classBodyValue: SyncBailHook<
|
4658
|
+
[
|
4659
|
+
Expression,
|
4660
|
+
MethodDefinition | PropertyDefinitionNode,
|
4661
|
+
ClassExpression | ClassDeclaration
|
4662
|
+
],
|
4640
4663
|
boolean | void
|
4641
4664
|
>;
|
4642
4665
|
label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
|
@@ -4765,7 +4788,6 @@ declare class JavascriptParser extends Parser {
|
|
4765
4788
|
currentTagData: any;
|
4766
4789
|
getRenameIdentifier(expr?: any): undefined | string;
|
4767
4790
|
walkClass(classy: ClassExpression | ClassDeclaration): void;
|
4768
|
-
walkMethodDefinition(methodDefinition?: any): void;
|
4769
4791
|
preWalkStatements(statements?: any): void;
|
4770
4792
|
blockPreWalkStatements(statements?: any): void;
|
4771
4793
|
walkStatements(statements?: any): void;
|
@@ -4950,7 +4972,8 @@ declare class JavascriptParser extends Parser {
|
|
4950
4972
|
| ChainExpression
|
4951
4973
|
| FunctionDeclaration
|
4952
4974
|
| VariableDeclaration
|
4953
|
-
| ClassDeclaration
|
4975
|
+
| ClassDeclaration
|
4976
|
+
| PrivateIdentifierNode,
|
4954
4977
|
commentsStartPos: number
|
4955
4978
|
): boolean;
|
4956
4979
|
getComments(range?: any): any[];
|
@@ -8094,6 +8117,12 @@ declare interface PrintedElement {
|
|
8094
8117
|
element: string;
|
8095
8118
|
content: string;
|
8096
8119
|
}
|
8120
|
+
declare interface PrivateIdentifierNode {
|
8121
|
+
type: "PrivateIdentifier";
|
8122
|
+
name: string;
|
8123
|
+
loc?: null | SourceLocation;
|
8124
|
+
range?: [number, number];
|
8125
|
+
}
|
8097
8126
|
declare interface Problem {
|
8098
8127
|
type: ProblemType;
|
8099
8128
|
path: string;
|
@@ -8211,6 +8240,71 @@ declare interface ProgressPluginOptions {
|
|
8211
8240
|
*/
|
8212
8241
|
profile?: null | boolean;
|
8213
8242
|
}
|
8243
|
+
declare interface PropertyDefinitionNode {
|
8244
|
+
type: "PropertyDefinition";
|
8245
|
+
key:
|
8246
|
+
| UnaryExpression
|
8247
|
+
| ThisExpression
|
8248
|
+
| ArrayExpression
|
8249
|
+
| ObjectExpression
|
8250
|
+
| FunctionExpression
|
8251
|
+
| ArrowFunctionExpression
|
8252
|
+
| YieldExpression
|
8253
|
+
| SimpleLiteral
|
8254
|
+
| RegExpLiteral
|
8255
|
+
| BigIntLiteral
|
8256
|
+
| UpdateExpression
|
8257
|
+
| BinaryExpression
|
8258
|
+
| AssignmentExpression
|
8259
|
+
| LogicalExpression
|
8260
|
+
| MemberExpression
|
8261
|
+
| ConditionalExpression
|
8262
|
+
| SimpleCallExpression
|
8263
|
+
| NewExpression
|
8264
|
+
| SequenceExpression
|
8265
|
+
| TemplateLiteral
|
8266
|
+
| TaggedTemplateExpression
|
8267
|
+
| ClassExpression
|
8268
|
+
| MetaProperty
|
8269
|
+
| Identifier
|
8270
|
+
| AwaitExpression
|
8271
|
+
| ImportExpression
|
8272
|
+
| ChainExpression
|
8273
|
+
| PrivateIdentifierNode;
|
8274
|
+
value:
|
8275
|
+
| null
|
8276
|
+
| UnaryExpression
|
8277
|
+
| ThisExpression
|
8278
|
+
| ArrayExpression
|
8279
|
+
| ObjectExpression
|
8280
|
+
| FunctionExpression
|
8281
|
+
| ArrowFunctionExpression
|
8282
|
+
| YieldExpression
|
8283
|
+
| SimpleLiteral
|
8284
|
+
| RegExpLiteral
|
8285
|
+
| BigIntLiteral
|
8286
|
+
| UpdateExpression
|
8287
|
+
| BinaryExpression
|
8288
|
+
| AssignmentExpression
|
8289
|
+
| LogicalExpression
|
8290
|
+
| MemberExpression
|
8291
|
+
| ConditionalExpression
|
8292
|
+
| SimpleCallExpression
|
8293
|
+
| NewExpression
|
8294
|
+
| SequenceExpression
|
8295
|
+
| TemplateLiteral
|
8296
|
+
| TaggedTemplateExpression
|
8297
|
+
| ClassExpression
|
8298
|
+
| MetaProperty
|
8299
|
+
| Identifier
|
8300
|
+
| AwaitExpression
|
8301
|
+
| ImportExpression
|
8302
|
+
| ChainExpression;
|
8303
|
+
computed: boolean;
|
8304
|
+
static: boolean;
|
8305
|
+
loc?: null | SourceLocation;
|
8306
|
+
range?: [number, number];
|
8307
|
+
}
|
8214
8308
|
declare class ProvidePlugin {
|
8215
8309
|
constructor(definitions: Record<string, string | string[]>);
|
8216
8310
|
definitions: Record<string, string | string[]>;
|