webpack 5.34.0 → 5.36.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/bin/webpack.js +0 -0
- package/lib/ChunkGraph.js +113 -30
- package/lib/Compilation.js +71 -41
- package/lib/ContextModuleFactory.js +4 -3
- package/lib/Dependency.js +74 -4
- package/lib/FileSystemInfo.js +25 -17
- package/lib/FlagDependencyExportsPlugin.js +38 -37
- package/lib/InitFragment.js +21 -6
- package/lib/ModuleGraph.js +19 -53
- package/lib/WebpackOptionsApply.js +3 -1
- package/lib/cache/PackFileCacheStrategy.js +81 -6
- package/lib/config/defaults.js +4 -2
- package/lib/config/normalization.js +1 -0
- package/lib/dependencies/HarmonyExportInitFragment.js +47 -0
- package/lib/dependencies/NullDependency.js +0 -8
- 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/serialization/BinaryMiddleware.js +42 -23
- package/lib/util/AsyncQueue.js +6 -1
- package/lib/util/comparators.js +23 -19
- package/lib/util/smartGrouping.js +76 -40
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +4 -2
- package/package.json +4 -4
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +8 -0
- package/types.d.ts +106 -7
@@ -924,6 +924,10 @@
|
|
924
924
|
"type": "object",
|
925
925
|
"additionalProperties": false,
|
926
926
|
"properties": {
|
927
|
+
"allowCollectingMemory": {
|
928
|
+
"description": "Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.",
|
929
|
+
"type": "boolean"
|
930
|
+
},
|
927
931
|
"buildDependencies": {
|
928
932
|
"description": "Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').",
|
929
933
|
"type": "object",
|
@@ -995,6 +999,10 @@
|
|
995
999
|
"description": "Name for the cache. Different names will lead to different coexisting caches.",
|
996
1000
|
"type": "string"
|
997
1001
|
},
|
1002
|
+
"profile": {
|
1003
|
+
"description": "Track and log detailed timing information for individual cache items.",
|
1004
|
+
"type": "boolean"
|
1005
|
+
},
|
998
1006
|
"store": {
|
999
1007
|
"description": "When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).",
|
1000
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
|
/**
|
@@ -3759,6 +3765,11 @@ declare class FetchCompileWasmPlugin {
|
|
3759
3765
|
* Options object for persistent file-based caching.
|
3760
3766
|
*/
|
3761
3767
|
declare interface FileCacheOptions {
|
3768
|
+
/**
|
3769
|
+
* Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.
|
3770
|
+
*/
|
3771
|
+
allowCollectingMemory?: boolean;
|
3772
|
+
|
3762
3773
|
/**
|
3763
3774
|
* Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').
|
3764
3775
|
*/
|
@@ -3814,6 +3825,11 @@ declare interface FileCacheOptions {
|
|
3814
3825
|
*/
|
3815
3826
|
name?: string;
|
3816
3827
|
|
3828
|
+
/**
|
3829
|
+
* Track and log detailed timing information for individual cache items.
|
3830
|
+
*/
|
3831
|
+
profile?: boolean;
|
3832
|
+
|
3817
3833
|
/**
|
3818
3834
|
* When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).
|
3819
3835
|
*/
|
@@ -4529,6 +4545,7 @@ declare class JavascriptParser extends Parser {
|
|
4529
4545
|
| FunctionDeclaration
|
4530
4546
|
| VariableDeclaration
|
4531
4547
|
| ClassDeclaration
|
4548
|
+
| PrivateIdentifierNode
|
4532
4549
|
),
|
4533
4550
|
number
|
4534
4551
|
],
|
@@ -4631,7 +4648,18 @@ declare class JavascriptParser extends Parser {
|
|
4631
4648
|
boolean | void
|
4632
4649
|
>;
|
4633
4650
|
classBodyElement: SyncBailHook<
|
4634
|
-
[
|
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
|
+
],
|
4635
4663
|
boolean | void
|
4636
4664
|
>;
|
4637
4665
|
label: HookMap<SyncBailHook<[LabeledStatement], boolean | void>>;
|
@@ -4760,7 +4788,6 @@ declare class JavascriptParser extends Parser {
|
|
4760
4788
|
currentTagData: any;
|
4761
4789
|
getRenameIdentifier(expr?: any): undefined | string;
|
4762
4790
|
walkClass(classy: ClassExpression | ClassDeclaration): void;
|
4763
|
-
walkMethodDefinition(methodDefinition?: any): void;
|
4764
4791
|
preWalkStatements(statements?: any): void;
|
4765
4792
|
blockPreWalkStatements(statements?: any): void;
|
4766
4793
|
walkStatements(statements?: any): void;
|
@@ -4945,7 +4972,8 @@ declare class JavascriptParser extends Parser {
|
|
4945
4972
|
| ChainExpression
|
4946
4973
|
| FunctionDeclaration
|
4947
4974
|
| VariableDeclaration
|
4948
|
-
| ClassDeclaration
|
4975
|
+
| ClassDeclaration
|
4976
|
+
| PrivateIdentifierNode,
|
4949
4977
|
commentsStartPos: number
|
4950
4978
|
): boolean;
|
4951
4979
|
getComments(range?: any): any[];
|
@@ -8089,6 +8117,12 @@ declare interface PrintedElement {
|
|
8089
8117
|
element: string;
|
8090
8118
|
content: string;
|
8091
8119
|
}
|
8120
|
+
declare interface PrivateIdentifierNode {
|
8121
|
+
type: "PrivateIdentifier";
|
8122
|
+
name: string;
|
8123
|
+
loc?: null | SourceLocation;
|
8124
|
+
range?: [number, number];
|
8125
|
+
}
|
8092
8126
|
declare interface Problem {
|
8093
8127
|
type: ProblemType;
|
8094
8128
|
path: string;
|
@@ -8206,6 +8240,71 @@ declare interface ProgressPluginOptions {
|
|
8206
8240
|
*/
|
8207
8241
|
profile?: null | boolean;
|
8208
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
|
+
}
|
8209
8308
|
declare class ProvidePlugin {
|
8210
8309
|
constructor(definitions: Record<string, string | string[]>);
|
8211
8310
|
definitions: Record<string, string | string[]>;
|