webpack 5.64.4 → 5.65.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.
- package/lib/ExternalModule.js +1 -1
- package/lib/RuntimeTemplate.js +92 -2
- package/lib/asset/AssetGenerator.js +7 -6
- package/lib/config/browserslistTargetHandler.js +38 -1
- package/lib/config/defaults.js +1 -1
- package/lib/config/target.js +10 -0
- package/lib/container/ContainerEntryModule.js +1 -3
- package/lib/index.js +3 -0
- package/lib/javascript/ArrayPushCallbackChunkFormatPlugin.js +2 -2
- package/lib/javascript/JavascriptParser.js +7 -0
- package/lib/library/AssignLibraryPlugin.js +5 -10
- package/lib/sharing/ConsumeSharedModule.js +4 -0
- package/lib/sharing/ConsumeSharedRuntimeModule.js +21 -0
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/util/extractUrlAndGlobal.js +3 -0
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +1 -1
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -1
- package/package.json +2 -2
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +8 -0
- package/types.d.ts +35 -19
@@ -680,6 +680,14 @@
|
|
680
680
|
"module": {
|
681
681
|
"description": "The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').",
|
682
682
|
"type": "boolean"
|
683
|
+
},
|
684
|
+
"optionalChaining": {
|
685
|
+
"description": "The environment supports optional chaining ('obj?.a' or 'obj?.()').",
|
686
|
+
"type": "boolean"
|
687
|
+
},
|
688
|
+
"templateLiteral": {
|
689
|
+
"description": "The environment supports template literals.",
|
690
|
+
"type": "boolean"
|
683
691
|
}
|
684
692
|
}
|
685
693
|
},
|
package/types.d.ts
CHANGED
@@ -2141,7 +2141,7 @@ declare interface Configuration {
|
|
2141
2141
|
/**
|
2142
2142
|
* Enable production optimizations or development hints.
|
2143
2143
|
*/
|
2144
|
-
mode?: "
|
2144
|
+
mode?: "none" | "development" | "production";
|
2145
2145
|
|
2146
2146
|
/**
|
2147
2147
|
* Options affecting the normal modules (`NormalModuleFactory`).
|
@@ -2226,15 +2226,15 @@ declare interface Configuration {
|
|
2226
2226
|
*/
|
2227
2227
|
stats?:
|
2228
2228
|
| boolean
|
2229
|
+
| StatsOptions
|
2229
2230
|
| "none"
|
2231
|
+
| "verbose"
|
2230
2232
|
| "summary"
|
2231
2233
|
| "errors-only"
|
2232
2234
|
| "errors-warnings"
|
2233
2235
|
| "minimal"
|
2234
2236
|
| "normal"
|
2235
|
-
| "detailed"
|
2236
|
-
| "verbose"
|
2237
|
-
| StatsOptions;
|
2237
|
+
| "detailed";
|
2238
2238
|
|
2239
2239
|
/**
|
2240
2240
|
* Environment to build for. An array of environments to build for all of them when possible.
|
@@ -3246,6 +3246,16 @@ declare interface Environment {
|
|
3246
3246
|
* The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
|
3247
3247
|
*/
|
3248
3248
|
module?: boolean;
|
3249
|
+
|
3250
|
+
/**
|
3251
|
+
* The environment supports optional chaining ('obj?.a' or 'obj?.()').
|
3252
|
+
*/
|
3253
|
+
optionalChaining?: boolean;
|
3254
|
+
|
3255
|
+
/**
|
3256
|
+
* The environment supports template literals.
|
3257
|
+
*/
|
3258
|
+
templateLiteral?: boolean;
|
3249
3259
|
}
|
3250
3260
|
declare class EnvironmentPlugin {
|
3251
3261
|
constructor(...keys: any[]);
|
@@ -4547,7 +4557,7 @@ declare interface InfrastructureLogging {
|
|
4547
4557
|
/**
|
4548
4558
|
* Log level.
|
4549
4559
|
*/
|
4550
|
-
level?: "none" | "
|
4560
|
+
level?: "none" | "error" | "warn" | "info" | "log" | "verbose";
|
4551
4561
|
|
4552
4562
|
/**
|
4553
4563
|
* Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.
|
@@ -4693,7 +4703,7 @@ declare class JavascriptModulesPlugin {
|
|
4693
4703
|
static chunkHasJs: (chunk: Chunk, chunkGraph: ChunkGraph) => boolean;
|
4694
4704
|
}
|
4695
4705
|
declare class JavascriptParser extends Parser {
|
4696
|
-
constructor(sourceType?: "module" | "
|
4706
|
+
constructor(sourceType?: "module" | "auto" | "script");
|
4697
4707
|
hooks: Readonly<{
|
4698
4708
|
evaluateTypeof: HookMap<
|
4699
4709
|
SyncBailHook<
|
@@ -4963,7 +4973,7 @@ declare class JavascriptParser extends Parser {
|
|
4963
4973
|
program: SyncBailHook<[Program, Comment[]], boolean | void>;
|
4964
4974
|
finish: SyncBailHook<[Program, Comment[]], boolean | void>;
|
4965
4975
|
}>;
|
4966
|
-
sourceType: "module" | "
|
4976
|
+
sourceType: "module" | "auto" | "script";
|
4967
4977
|
scope: ScopeInfo;
|
4968
4978
|
state: ParserState;
|
4969
4979
|
comments: any;
|
@@ -5303,7 +5313,7 @@ declare interface JavascriptParserOptions {
|
|
5303
5313
|
/**
|
5304
5314
|
* Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
|
5305
5315
|
*/
|
5306
|
-
exportsPresence?: false | "
|
5316
|
+
exportsPresence?: false | "auto" | "error" | "warn";
|
5307
5317
|
|
5308
5318
|
/**
|
5309
5319
|
* Enable warnings for full dynamic dependencies.
|
@@ -5338,7 +5348,7 @@ declare interface JavascriptParserOptions {
|
|
5338
5348
|
/**
|
5339
5349
|
* Specifies the behavior of invalid export names in "import ... from ...".
|
5340
5350
|
*/
|
5341
|
-
importExportsPresence?: false | "
|
5351
|
+
importExportsPresence?: false | "auto" | "error" | "warn";
|
5342
5352
|
|
5343
5353
|
/**
|
5344
5354
|
* Include polyfills or mocks for various node stuff.
|
@@ -5348,7 +5358,7 @@ declare interface JavascriptParserOptions {
|
|
5348
5358
|
/**
|
5349
5359
|
* 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
5360
|
*/
|
5351
|
-
reexportExportsPresence?: false | "
|
5361
|
+
reexportExportsPresence?: false | "auto" | "error" | "warn";
|
5352
5362
|
|
5353
5363
|
/**
|
5354
5364
|
* Enable/disable parsing of require.context syntax.
|
@@ -5585,7 +5595,7 @@ declare interface KnownNormalizedStatsOptions {
|
|
5585
5595
|
modulesSpace: number;
|
5586
5596
|
chunkModulesSpace: number;
|
5587
5597
|
nestedModulesSpace: number;
|
5588
|
-
logging: false | "none" | "
|
5598
|
+
logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
|
5589
5599
|
loggingDebug: ((value: string) => boolean)[];
|
5590
5600
|
loggingTrace: boolean;
|
5591
5601
|
}
|
@@ -7543,7 +7553,7 @@ declare interface NormalModuleLoaderContext<OptionsType> {
|
|
7543
7553
|
rootContext: string;
|
7544
7554
|
fs: InputFileSystem;
|
7545
7555
|
sourceMap?: boolean;
|
7546
|
-
mode: "
|
7556
|
+
mode: "none" | "development" | "production";
|
7547
7557
|
webpack?: boolean;
|
7548
7558
|
_module?: NormalModule;
|
7549
7559
|
_compilation?: Compilation;
|
@@ -9400,7 +9410,7 @@ declare interface ResolveOptionsWebpackOptions {
|
|
9400
9410
|
/**
|
9401
9411
|
* Plugins for the resolver.
|
9402
9412
|
*/
|
9403
|
-
plugins?: ("..."
|
9413
|
+
plugins?: (ResolvePluginInstance | "...")[];
|
9404
9414
|
|
9405
9415
|
/**
|
9406
9416
|
* Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.
|
@@ -10012,18 +10022,21 @@ declare abstract class RuntimeTemplate {
|
|
10012
10022
|
compilation: Compilation;
|
10013
10023
|
outputOptions: OutputNormalized;
|
10014
10024
|
requestShortener: RequestShortener;
|
10025
|
+
globalObject: string;
|
10015
10026
|
isIIFE(): undefined | boolean;
|
10016
10027
|
isModule(): undefined | boolean;
|
10017
10028
|
supportsConst(): undefined | boolean;
|
10018
10029
|
supportsArrowFunction(): undefined | boolean;
|
10030
|
+
supportsOptionalChaining(): undefined | boolean;
|
10019
10031
|
supportsForOf(): undefined | boolean;
|
10020
10032
|
supportsDestructuring(): undefined | boolean;
|
10021
10033
|
supportsBigIntLiteral(): undefined | boolean;
|
10022
10034
|
supportsDynamicImport(): undefined | boolean;
|
10023
10035
|
supportsEcmaScriptModuleSyntax(): undefined | boolean;
|
10024
|
-
supportTemplateLiteral(): boolean;
|
10036
|
+
supportTemplateLiteral(): undefined | boolean;
|
10025
10037
|
returningFunction(returnValue?: any, args?: string): string;
|
10026
10038
|
basicFunction(args?: any, body?: any): string;
|
10039
|
+
concatenation(...args: (string | { expr: string })[]): string;
|
10027
10040
|
expressionFunction(expression?: any, args?: string): string;
|
10028
10041
|
emptyFunction(): "x => {}" | "function() {}";
|
10029
10042
|
destructureArray(items?: any, value?: any): string;
|
@@ -11239,7 +11252,7 @@ declare interface StatsOptions {
|
|
11239
11252
|
/**
|
11240
11253
|
* Add logging output.
|
11241
11254
|
*/
|
11242
|
-
logging?: boolean | "none" | "
|
11255
|
+
logging?: boolean | "none" | "error" | "warn" | "info" | "log" | "verbose";
|
11243
11256
|
|
11244
11257
|
/**
|
11245
11258
|
* Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
|
@@ -11408,15 +11421,15 @@ type StatsPrinterContext = KnownStatsPrinterContext & Record<string, any>;
|
|
11408
11421
|
type StatsProfile = KnownStatsProfile & Record<string, any>;
|
11409
11422
|
type StatsValue =
|
11410
11423
|
| boolean
|
11424
|
+
| StatsOptions
|
11411
11425
|
| "none"
|
11426
|
+
| "verbose"
|
11412
11427
|
| "summary"
|
11413
11428
|
| "errors-only"
|
11414
11429
|
| "errors-warnings"
|
11415
11430
|
| "minimal"
|
11416
11431
|
| "normal"
|
11417
|
-
| "detailed"
|
11418
|
-
| "verbose"
|
11419
|
-
| StatsOptions;
|
11432
|
+
| "detailed";
|
11420
11433
|
declare interface SyntheticDependencyLocation {
|
11421
11434
|
name: string;
|
11422
11435
|
index?: number;
|
@@ -12026,7 +12039,7 @@ declare interface WebpackOptionsNormalized {
|
|
12026
12039
|
/**
|
12027
12040
|
* Enable production optimizations or development hints.
|
12028
12041
|
*/
|
12029
|
-
mode?: "
|
12042
|
+
mode?: "none" | "development" | "production";
|
12030
12043
|
|
12031
12044
|
/**
|
12032
12045
|
* Options affecting the normal modules (`NormalModuleFactory`).
|
@@ -12698,6 +12711,7 @@ declare namespace exports {
|
|
12698
12711
|
RuleSetRule,
|
12699
12712
|
RuleSetUse,
|
12700
12713
|
RuleSetUseItem,
|
12714
|
+
StatsOptions,
|
12701
12715
|
Configuration,
|
12702
12716
|
WebpackOptionsNormalized,
|
12703
12717
|
WebpackPluginInstance,
|
@@ -12705,6 +12719,8 @@ declare namespace exports {
|
|
12705
12719
|
AssetInfo,
|
12706
12720
|
MultiStats,
|
12707
12721
|
ParserState,
|
12722
|
+
ResolvePluginInstance,
|
12723
|
+
Resolver,
|
12708
12724
|
Watching,
|
12709
12725
|
StatsAsset,
|
12710
12726
|
StatsChunk,
|