webpack 5.61.0 → 5.63.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/Chunk.js +3 -2
- package/lib/Compilation.js +36 -20
- package/lib/Compiler.js +13 -11
- package/lib/FileSystemInfo.js +7 -6
- package/lib/HotModuleReplacementPlugin.js +3 -1
- package/lib/RuntimePlugin.js +9 -1
- package/lib/buildChunkGraph.js +25 -5
- package/lib/cache/PackFileCacheStrategy.js +3 -3
- package/lib/config/defaults.js +18 -10
- package/lib/config/normalization.js +1 -0
- package/lib/dependencies/AMDRequireDependency.js +6 -6
- package/lib/dependencies/CommonJsFullRequireDependency.js +5 -1
- package/lib/dependencies/CommonJsImportsParserPlugin.js +3 -1
- package/lib/dependencies/CommonJsRequireContextDependency.js +5 -1
- package/lib/dependencies/ContextDependency.js +1 -0
- package/lib/dependencies/ContextDependencyTemplateAsRequireCall.js +4 -1
- package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +12 -3
- package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +25 -17
- package/lib/dependencies/HarmonyImportDependency.js +23 -0
- package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +17 -4
- package/lib/dependencies/HarmonyImportSpecifierDependency.js +24 -14
- package/lib/dependencies/RequireEnsureDependency.js +2 -2
- package/lib/hmr/lazyCompilationBackend.js +6 -1
- package/lib/node/RequireChunkLoadingRuntimeModule.js +1 -1
- package/lib/optimize/ModuleConcatenationPlugin.js +5 -2
- package/lib/optimize/SplitChunksPlugin.js +8 -1
- package/lib/runtime/AsyncModuleRuntimeModule.js +2 -2
- package/lib/sharing/ConsumeSharedRuntimeModule.js +1 -1
- package/lib/sharing/ShareRuntimeModule.js +1 -1
- package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
- package/lib/util/deprecation.js +10 -2
- package/lib/util/hash/BatchedHash.js +5 -1
- package/lib/util/hash/wasm-hash.js +1 -1
- package/lib/webpack.js +1 -2
- package/module.d.ts +200 -0
- package/package.json +12 -10
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +45 -21
- package/types.d.ts +33 -13
@@ -681,14 +681,14 @@
|
|
681
681
|
"implements": ["#/definitions/ExperimentsCommon"],
|
682
682
|
"additionalProperties": false,
|
683
683
|
"properties": {
|
684
|
-
"asset": {
|
685
|
-
"description": "Allow module type 'asset' to generate assets.",
|
686
|
-
"type": "boolean"
|
687
|
-
},
|
688
684
|
"asyncWebAssembly": {
|
689
685
|
"description": "Support WebAssembly as asynchronous EcmaScript Module.",
|
690
686
|
"type": "boolean"
|
691
687
|
},
|
688
|
+
"backCompat": {
|
689
|
+
"description": "Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.",
|
690
|
+
"type": "boolean"
|
691
|
+
},
|
692
692
|
"buildHttp": {
|
693
693
|
"description": "Build http(s): urls using a lockfile and resource content cache.",
|
694
694
|
"anyOf": [
|
@@ -709,7 +709,7 @@
|
|
709
709
|
"type": "boolean"
|
710
710
|
},
|
711
711
|
"layers": {
|
712
|
-
"description": "Enable module
|
712
|
+
"description": "Enable module layers.",
|
713
713
|
"type": "boolean"
|
714
714
|
},
|
715
715
|
"lazyCompilation": {
|
@@ -742,14 +742,14 @@
|
|
742
742
|
"type": "object",
|
743
743
|
"additionalProperties": false,
|
744
744
|
"properties": {
|
745
|
-
"asset": {
|
746
|
-
"description": "Allow module type 'asset' to generate assets.",
|
747
|
-
"type": "boolean"
|
748
|
-
},
|
749
745
|
"asyncWebAssembly": {
|
750
746
|
"description": "Support WebAssembly as asynchronous EcmaScript Module.",
|
751
747
|
"type": "boolean"
|
752
748
|
},
|
749
|
+
"backCompat": {
|
750
|
+
"description": "Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.",
|
751
|
+
"type": "boolean"
|
752
|
+
},
|
753
753
|
"cacheUnaffected": {
|
754
754
|
"description": "Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.",
|
755
755
|
"type": "boolean"
|
@@ -759,7 +759,7 @@
|
|
759
759
|
"type": "boolean"
|
760
760
|
},
|
761
761
|
"layers": {
|
762
|
-
"description": "Enable module
|
762
|
+
"description": "Enable module layers.",
|
763
763
|
"type": "boolean"
|
764
764
|
},
|
765
765
|
"outputModule": {
|
@@ -782,14 +782,14 @@
|
|
782
782
|
"implements": ["#/definitions/ExperimentsCommon"],
|
783
783
|
"additionalProperties": false,
|
784
784
|
"properties": {
|
785
|
-
"asset": {
|
786
|
-
"description": "Allow module type 'asset' to generate assets.",
|
787
|
-
"type": "boolean"
|
788
|
-
},
|
789
785
|
"asyncWebAssembly": {
|
790
786
|
"description": "Support WebAssembly as asynchronous EcmaScript Module.",
|
791
787
|
"type": "boolean"
|
792
788
|
},
|
789
|
+
"backCompat": {
|
790
|
+
"description": "Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.",
|
791
|
+
"type": "boolean"
|
792
|
+
},
|
793
793
|
"buildHttp": {
|
794
794
|
"description": "Build http(s): urls using a lockfile and resource content cache.",
|
795
795
|
"oneOf": [
|
@@ -807,7 +807,7 @@
|
|
807
807
|
"type": "boolean"
|
808
808
|
},
|
809
809
|
"layers": {
|
810
|
-
"description": "Enable module
|
810
|
+
"description": "Enable module layers.",
|
811
811
|
"type": "boolean"
|
812
812
|
},
|
813
813
|
"lazyCompilation": {
|
@@ -1068,12 +1068,12 @@
|
|
1068
1068
|
"description": "List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.",
|
1069
1069
|
"anyOf": [
|
1070
1070
|
{
|
1071
|
-
"description": "A RegExp matching
|
1071
|
+
"description": "A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)",
|
1072
1072
|
"instanceof": "RegExp",
|
1073
1073
|
"tsType": "RegExp"
|
1074
1074
|
},
|
1075
1075
|
{
|
1076
|
-
"description": "A path to
|
1076
|
+
"description": "A path to an immutable directory (usually a package manager cache directory).",
|
1077
1077
|
"type": "string",
|
1078
1078
|
"absolutePath": true,
|
1079
1079
|
"minLength": 1
|
@@ -1474,6 +1474,10 @@
|
|
1474
1474
|
"description": "Enable/disable parsing of magic comments in CommonJs syntax.",
|
1475
1475
|
"type": "boolean"
|
1476
1476
|
},
|
1477
|
+
"exportsPresence": {
|
1478
|
+
"description": "Specifies the behavior of invalid export names in \"import ... from ...\" and \"export ... from ...\".",
|
1479
|
+
"enum": ["error", "warn", "auto", false]
|
1480
|
+
},
|
1477
1481
|
"exprContextCritical": {
|
1478
1482
|
"description": "Enable warnings for full dynamic dependencies.",
|
1479
1483
|
"type": "boolean"
|
@@ -1506,9 +1510,17 @@
|
|
1506
1510
|
"description": "Enable/disable parsing of import() syntax.",
|
1507
1511
|
"type": "boolean"
|
1508
1512
|
},
|
1513
|
+
"importExportsPresence": {
|
1514
|
+
"description": "Specifies the behavior of invalid export names in \"import ... from ...\".",
|
1515
|
+
"enum": ["error", "warn", "auto", false]
|
1516
|
+
},
|
1509
1517
|
"node": {
|
1510
1518
|
"$ref": "#/definitions/Node"
|
1511
1519
|
},
|
1520
|
+
"reexportExportsPresence": {
|
1521
|
+
"description": "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.",
|
1522
|
+
"enum": ["error", "warn", "auto", false]
|
1523
|
+
},
|
1512
1524
|
"requireContext": {
|
1513
1525
|
"description": "Enable/disable parsing of require.context syntax.",
|
1514
1526
|
"type": "boolean"
|
@@ -1526,7 +1538,7 @@
|
|
1526
1538
|
"type": "boolean"
|
1527
1539
|
},
|
1528
1540
|
"strictExportPresence": {
|
1529
|
-
"description": "Emit errors instead of warnings when imported names don't exist in imported module.",
|
1541
|
+
"description": "Deprecated in favor of \"exportsPresence\". Emit errors instead of warnings when imported names don't exist in imported module.",
|
1530
1542
|
"type": "boolean"
|
1531
1543
|
},
|
1532
1544
|
"strictThisContextOnImports": {
|
@@ -1638,7 +1650,7 @@
|
|
1638
1650
|
"properties": {
|
1639
1651
|
"host": {
|
1640
1652
|
"description": "A host.",
|
1641
|
-
"type": "
|
1653
|
+
"type": "string"
|
1642
1654
|
},
|
1643
1655
|
"port": {
|
1644
1656
|
"description": "A port.",
|
@@ -2697,6 +2709,18 @@
|
|
2697
2709
|
"type": "string",
|
2698
2710
|
"minLength": 1
|
2699
2711
|
},
|
2712
|
+
"chunks": {
|
2713
|
+
"description": "Select chunks for determining shared modules (defaults to \"async\", \"initial\" and \"all\" requires adding these chunks to the HTML).",
|
2714
|
+
"anyOf": [
|
2715
|
+
{
|
2716
|
+
"enum": ["initial", "async", "all"]
|
2717
|
+
},
|
2718
|
+
{
|
2719
|
+
"instanceof": "Function",
|
2720
|
+
"tsType": "((chunk: import('../lib/Chunk')) => boolean)"
|
2721
|
+
}
|
2722
|
+
]
|
2723
|
+
},
|
2700
2724
|
"maxAsyncSize": {
|
2701
2725
|
"description": "Maximal size hint for the on-demand chunks.",
|
2702
2726
|
"oneOf": [
|
@@ -4204,12 +4228,12 @@
|
|
4204
4228
|
"description": "List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.",
|
4205
4229
|
"anyOf": [
|
4206
4230
|
{
|
4207
|
-
"description": "A RegExp matching
|
4231
|
+
"description": "A RegExp matching an immutable directory (usually a package manager cache directory, including the tailing slash)",
|
4208
4232
|
"instanceof": "RegExp",
|
4209
4233
|
"tsType": "RegExp"
|
4210
4234
|
},
|
4211
4235
|
{
|
4212
|
-
"description": "A path to
|
4236
|
+
"description": "A path to an immutable directory (usually a package manager cache directory).",
|
4213
4237
|
"type": "string",
|
4214
4238
|
"absolutePath": true,
|
4215
4239
|
"minLength": 1
|
package/types.d.ts
CHANGED
@@ -691,7 +691,7 @@ declare interface CallbackWebpack<T> {
|
|
691
691
|
}
|
692
692
|
type Cell<T> = undefined | T;
|
693
693
|
declare class Chunk {
|
694
|
-
constructor(name?: string);
|
694
|
+
constructor(name?: string, backCompat?: boolean);
|
695
695
|
id: null | string | number;
|
696
696
|
ids: null | (string | number)[];
|
697
697
|
debugId: number;
|
@@ -1393,22 +1393,22 @@ declare class Compilation {
|
|
1393
1393
|
additionalChunkAssets: FakeHook<
|
1394
1394
|
Pick<
|
1395
1395
|
AsyncSeriesHook<[Set<Chunk>]>,
|
1396
|
-
"
|
1396
|
+
"name" | "tap" | "tapAsync" | "tapPromise"
|
1397
1397
|
>
|
1398
1398
|
>;
|
1399
1399
|
additionalAssets: FakeHook<
|
1400
|
-
Pick<AsyncSeriesHook<[]>, "
|
1400
|
+
Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">
|
1401
1401
|
>;
|
1402
1402
|
optimizeChunkAssets: FakeHook<
|
1403
1403
|
Pick<
|
1404
1404
|
AsyncSeriesHook<[Set<Chunk>]>,
|
1405
|
-
"
|
1405
|
+
"name" | "tap" | "tapAsync" | "tapPromise"
|
1406
1406
|
>
|
1407
1407
|
>;
|
1408
1408
|
afterOptimizeChunkAssets: FakeHook<
|
1409
1409
|
Pick<
|
1410
1410
|
AsyncSeriesHook<[Set<Chunk>]>,
|
1411
|
-
"
|
1411
|
+
"name" | "tap" | "tapAsync" | "tapPromise"
|
1412
1412
|
>
|
1413
1413
|
>;
|
1414
1414
|
optimizeAssets: AsyncSeriesHook<
|
@@ -1857,7 +1857,7 @@ declare interface CompilationParams {
|
|
1857
1857
|
contextModuleFactory: ContextModuleFactory;
|
1858
1858
|
}
|
1859
1859
|
declare class Compiler {
|
1860
|
-
constructor(context: string);
|
1860
|
+
constructor(context: string, options?: WebpackOptionsNormalized);
|
1861
1861
|
hooks: Readonly<{
|
1862
1862
|
initialize: SyncHook<[]>;
|
1863
1863
|
shouldEmit: SyncBailHook<[Compilation], boolean>;
|
@@ -2455,7 +2455,7 @@ declare abstract class ContextModuleFactory extends ModuleFactory {
|
|
2455
2455
|
alternatives: FakeHook<
|
2456
2456
|
Pick<
|
2457
2457
|
AsyncSeriesWaterfallHook<[any[]]>,
|
2458
|
-
"
|
2458
|
+
"name" | "tap" | "tapAsync" | "tapPromise"
|
2459
2459
|
>
|
2460
2460
|
>;
|
2461
2461
|
alternativeRequests: AsyncSeriesWaterfallHook<
|
@@ -3304,14 +3304,14 @@ type Experiments = ExperimentsCommon & ExperimentsExtra;
|
|
3304
3304
|
*/
|
3305
3305
|
declare interface ExperimentsCommon {
|
3306
3306
|
/**
|
3307
|
-
*
|
3307
|
+
* Support WebAssembly as asynchronous EcmaScript Module.
|
3308
3308
|
*/
|
3309
|
-
|
3309
|
+
asyncWebAssembly?: boolean;
|
3310
3310
|
|
3311
3311
|
/**
|
3312
|
-
*
|
3312
|
+
* Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.
|
3313
3313
|
*/
|
3314
|
-
|
3314
|
+
backCompat?: boolean;
|
3315
3315
|
|
3316
3316
|
/**
|
3317
3317
|
* Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.
|
@@ -3324,7 +3324,7 @@ declare interface ExperimentsCommon {
|
|
3324
3324
|
futureDefaults?: boolean;
|
3325
3325
|
|
3326
3326
|
/**
|
3327
|
-
* Enable module
|
3327
|
+
* Enable module layers.
|
3328
3328
|
*/
|
3329
3329
|
layers?: boolean;
|
3330
3330
|
|
@@ -3859,6 +3859,7 @@ declare interface FactorizeModuleOptions {
|
|
3859
3859
|
type FakeHook<T> = T & FakeHookMarker;
|
3860
3860
|
declare interface FakeHookMarker {}
|
3861
3861
|
declare interface FallbackCacheGroup {
|
3862
|
+
chunksFilter: (chunk: Chunk) => boolean;
|
3862
3863
|
minSize: SplitChunksSizes;
|
3863
3864
|
maxAsyncSize: SplitChunksSizes;
|
3864
3865
|
maxInitialSize: SplitChunksSizes;
|
@@ -5289,6 +5290,11 @@ declare interface JavascriptParserOptions {
|
|
5289
5290
|
*/
|
5290
5291
|
commonjsMagicComments?: boolean;
|
5291
5292
|
|
5293
|
+
/**
|
5294
|
+
* Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
|
5295
|
+
*/
|
5296
|
+
exportsPresence?: false | "error" | "warn" | "auto";
|
5297
|
+
|
5292
5298
|
/**
|
5293
5299
|
* Enable warnings for full dynamic dependencies.
|
5294
5300
|
*/
|
@@ -5319,11 +5325,21 @@ declare interface JavascriptParserOptions {
|
|
5319
5325
|
*/
|
5320
5326
|
import?: boolean;
|
5321
5327
|
|
5328
|
+
/**
|
5329
|
+
* Specifies the behavior of invalid export names in "import ... from ...".
|
5330
|
+
*/
|
5331
|
+
importExportsPresence?: false | "error" | "warn" | "auto";
|
5332
|
+
|
5322
5333
|
/**
|
5323
5334
|
* Include polyfills or mocks for various node stuff.
|
5324
5335
|
*/
|
5325
5336
|
node?: false | NodeOptions;
|
5326
5337
|
|
5338
|
+
/**
|
5339
|
+
* 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.
|
5340
|
+
*/
|
5341
|
+
reexportExportsPresence?: false | "error" | "warn" | "auto";
|
5342
|
+
|
5327
5343
|
/**
|
5328
5344
|
* Enable/disable parsing of require.context syntax.
|
5329
5345
|
*/
|
@@ -5345,7 +5361,7 @@ declare interface JavascriptParserOptions {
|
|
5345
5361
|
requireJs?: boolean;
|
5346
5362
|
|
5347
5363
|
/**
|
5348
|
-
* Emit errors instead of warnings when imported names don't exist in imported module.
|
5364
|
+
* Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
|
5349
5365
|
*/
|
5350
5366
|
strictExportPresence?: boolean;
|
5351
5367
|
|
@@ -7931,6 +7947,10 @@ declare interface OptimizationSplitChunksOptions {
|
|
7931
7947
|
* Sets the name delimiter for created chunks.
|
7932
7948
|
*/
|
7933
7949
|
automaticNameDelimiter?: string;
|
7950
|
+
/**
|
7951
|
+
* Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
|
7952
|
+
*/
|
7953
|
+
chunks?: "all" | "initial" | "async" | ((chunk: Chunk) => boolean);
|
7934
7954
|
/**
|
7935
7955
|
* Maximal size hint for the on-demand chunks.
|
7936
7956
|
*/
|