webpack 5.58.2 → 5.59.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.

@@ -678,6 +678,7 @@
678
678
  "Experiments": {
679
679
  "description": "Enables/Disables experiments (experimental features with relax SemVer compatibility).",
680
680
  "type": "object",
681
+ "implements": ["#/definitions/ExperimentsCommon"],
681
682
  "additionalProperties": false,
682
683
  "properties": {
683
684
  "asset": {
@@ -692,7 +693,7 @@
692
693
  "description": "Build http(s): urls using a lockfile and resource content cache.",
693
694
  "anyOf": [
694
695
  {
695
- "type": "boolean"
696
+ "$ref": "#/definitions/HttpUriAllowedUris"
696
697
  },
697
698
  {
698
699
  "$ref": "#/definitions/HttpUriOptions"
@@ -718,43 +719,102 @@
718
719
  "type": "boolean"
719
720
  },
720
721
  {
721
- "type": "object",
722
- "additionalProperties": false,
723
- "properties": {
724
- "backend": {
725
- "description": "A custom backend.",
726
- "instanceof": "Function",
727
- "tsType": "(((compiler: import('../lib/Compiler'), client: string, callback: (err?: Error, api?: any) => void) => void) | ((compiler: import('../lib/Compiler'), client: string) => Promise<any>))"
728
- },
729
- "client": {
730
- "description": "A custom client.",
731
- "type": "string"
732
- },
733
- "entries": {
734
- "description": "Enable/disable lazy compilation for entries.",
735
- "type": "boolean"
736
- },
737
- "imports": {
738
- "description": "Enable/disable lazy compilation for import() modules.",
739
- "type": "boolean"
740
- },
741
- "test": {
742
- "description": "Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.",
743
- "anyOf": [
744
- {
745
- "instanceof": "RegExp",
746
- "tsType": "RegExp"
747
- },
748
- {
749
- "type": "string"
750
- },
751
- {
752
- "instanceof": "Function",
753
- "tsType": "((module: import('../lib/Module')) => boolean)"
754
- }
755
- ]
756
- }
757
- }
722
+ "$ref": "#/definitions/LazyCompilationOptions"
723
+ }
724
+ ]
725
+ },
726
+ "outputModule": {
727
+ "description": "Allow output javascript files as module source type.",
728
+ "type": "boolean"
729
+ },
730
+ "syncWebAssembly": {
731
+ "description": "Support WebAssembly as synchronous EcmaScript Module (outdated).",
732
+ "type": "boolean"
733
+ },
734
+ "topLevelAwait": {
735
+ "description": "Allow using top-level-await in EcmaScript Modules.",
736
+ "type": "boolean"
737
+ }
738
+ }
739
+ },
740
+ "ExperimentsCommon": {
741
+ "description": "Enables/Disables experiments (experimental features with relax SemVer compatibility).",
742
+ "type": "object",
743
+ "additionalProperties": false,
744
+ "properties": {
745
+ "asset": {
746
+ "description": "Allow module type 'asset' to generate assets.",
747
+ "type": "boolean"
748
+ },
749
+ "asyncWebAssembly": {
750
+ "description": "Support WebAssembly as asynchronous EcmaScript Module.",
751
+ "type": "boolean"
752
+ },
753
+ "cacheUnaffected": {
754
+ "description": "Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.",
755
+ "type": "boolean"
756
+ },
757
+ "futureDefaults": {
758
+ "description": "Apply defaults of next major version.",
759
+ "type": "boolean"
760
+ },
761
+ "layers": {
762
+ "description": "Enable module and chunk layers.",
763
+ "type": "boolean"
764
+ },
765
+ "outputModule": {
766
+ "description": "Allow output javascript files as module source type.",
767
+ "type": "boolean"
768
+ },
769
+ "syncWebAssembly": {
770
+ "description": "Support WebAssembly as synchronous EcmaScript Module (outdated).",
771
+ "type": "boolean"
772
+ },
773
+ "topLevelAwait": {
774
+ "description": "Allow using top-level-await in EcmaScript Modules.",
775
+ "type": "boolean"
776
+ }
777
+ }
778
+ },
779
+ "ExperimentsNormalized": {
780
+ "description": "Enables/Disables experiments (experimental features with relax SemVer compatibility).",
781
+ "type": "object",
782
+ "implements": ["#/definitions/ExperimentsCommon"],
783
+ "additionalProperties": false,
784
+ "properties": {
785
+ "asset": {
786
+ "description": "Allow module type 'asset' to generate assets.",
787
+ "type": "boolean"
788
+ },
789
+ "asyncWebAssembly": {
790
+ "description": "Support WebAssembly as asynchronous EcmaScript Module.",
791
+ "type": "boolean"
792
+ },
793
+ "buildHttp": {
794
+ "description": "Build http(s): urls using a lockfile and resource content cache.",
795
+ "oneOf": [
796
+ {
797
+ "$ref": "#/definitions/HttpUriOptions"
798
+ }
799
+ ]
800
+ },
801
+ "cacheUnaffected": {
802
+ "description": "Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.",
803
+ "type": "boolean"
804
+ },
805
+ "futureDefaults": {
806
+ "description": "Apply defaults of next major version.",
807
+ "type": "boolean"
808
+ },
809
+ "layers": {
810
+ "description": "Enable module and chunk layers.",
811
+ "type": "boolean"
812
+ },
813
+ "lazyCompilation": {
814
+ "description": "Compile entrypoints and import()s only when they are accessed.",
815
+ "oneOf": [
816
+ {
817
+ "$ref": "#/definitions/LazyCompilationOptions"
758
818
  }
759
819
  ]
760
820
  },
@@ -1005,20 +1065,40 @@
1005
1065
  "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.",
1006
1066
  "type": "array",
1007
1067
  "items": {
1008
- "description": "A path to a immutable directory (usually a package manager cache directory).",
1009
- "type": "string",
1010
- "absolutePath": true,
1011
- "minLength": 1
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
+ "anyOf": [
1070
+ {
1071
+ "description": "A RegExp matching a immutable directory (usually a package manager cache directory, including the tailing slash)",
1072
+ "instanceof": "RegExp",
1073
+ "tsType": "RegExp"
1074
+ },
1075
+ {
1076
+ "description": "A path to a immutable directory (usually a package manager cache directory).",
1077
+ "type": "string",
1078
+ "absolutePath": true,
1079
+ "minLength": 1
1080
+ }
1081
+ ]
1012
1082
  }
1013
1083
  },
1014
1084
  "managedPaths": {
1015
1085
  "description": "List of paths that are managed by a package manager and can be trusted to not be modified otherwise.",
1016
1086
  "type": "array",
1017
1087
  "items": {
1018
- "description": "A path to a managed directory (usually a node_modules directory).",
1019
- "type": "string",
1020
- "absolutePath": true,
1021
- "minLength": 1
1088
+ "description": "List of paths that are managed by a package manager and can be trusted to not be modified otherwise.",
1089
+ "anyOf": [
1090
+ {
1091
+ "description": "A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)",
1092
+ "instanceof": "RegExp",
1093
+ "tsType": "RegExp"
1094
+ },
1095
+ {
1096
+ "description": "A path to a managed directory (usually a node_modules directory).",
1097
+ "type": "string",
1098
+ "absolutePath": true,
1099
+ "minLength": 1
1100
+ }
1101
+ ]
1022
1102
  }
1023
1103
  },
1024
1104
  "maxAge": {
@@ -1203,11 +1283,25 @@
1203
1283
  "type": "string",
1204
1284
  "absolutePath": false
1205
1285
  },
1286
+ "HttpUriAllowedUris": {
1287
+ "description": "List of allowed URIs for building http resources.",
1288
+ "cli": {
1289
+ "exclude": true
1290
+ },
1291
+ "oneOf": [
1292
+ {
1293
+ "$ref": "#/definitions/HttpUriOptionsAllowedUris"
1294
+ }
1295
+ ]
1296
+ },
1206
1297
  "HttpUriOptions": {
1207
1298
  "description": "Options for building http resources.",
1208
1299
  "type": "object",
1209
1300
  "additionalProperties": false,
1210
1301
  "properties": {
1302
+ "allowedUris": {
1303
+ "$ref": "#/definitions/HttpUriOptionsAllowedUris"
1304
+ },
1211
1305
  "cacheLocation": {
1212
1306
  "description": "Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.",
1213
1307
  "anyOf": [
@@ -1233,6 +1327,31 @@
1233
1327
  "description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.",
1234
1328
  "type": "boolean"
1235
1329
  }
1330
+ },
1331
+ "required": ["allowedUris"]
1332
+ },
1333
+ "HttpUriOptionsAllowedUris": {
1334
+ "description": "List of allowed URIs (resp. the beginning of them).",
1335
+ "type": "array",
1336
+ "items": {
1337
+ "description": "List of allowed URIs (resp. the beginning of them).",
1338
+ "anyOf": [
1339
+ {
1340
+ "description": "Allowed URI pattern.",
1341
+ "instanceof": "RegExp",
1342
+ "tsType": "RegExp"
1343
+ },
1344
+ {
1345
+ "description": "Allowed URI (resp. the beginning of it).",
1346
+ "type": "string",
1347
+ "pattern": "^https?://"
1348
+ },
1349
+ {
1350
+ "description": "Allowed URI filter function.",
1351
+ "instanceof": "Function",
1352
+ "tsType": "((uri: string) => boolean)"
1353
+ }
1354
+ ]
1236
1355
  }
1237
1356
  },
1238
1357
  "IgnoreWarnings": {
@@ -1496,6 +1615,46 @@
1496
1615
  }
1497
1616
  ]
1498
1617
  },
1618
+ "LazyCompilationOptions": {
1619
+ "description": "Options for compiling entrypoints and import()s only when they are accessed.",
1620
+ "type": "object",
1621
+ "additionalProperties": false,
1622
+ "properties": {
1623
+ "backend": {
1624
+ "description": "A custom backend.",
1625
+ "instanceof": "Function",
1626
+ "tsType": "(((compiler: import('../lib/Compiler'), client: string, callback: (err?: Error, api?: any) => void) => void) | ((compiler: import('../lib/Compiler'), client: string) => Promise<any>))"
1627
+ },
1628
+ "client": {
1629
+ "description": "A custom client.",
1630
+ "type": "string"
1631
+ },
1632
+ "entries": {
1633
+ "description": "Enable/disable lazy compilation for entries.",
1634
+ "type": "boolean"
1635
+ },
1636
+ "imports": {
1637
+ "description": "Enable/disable lazy compilation for import() modules.",
1638
+ "type": "boolean"
1639
+ },
1640
+ "test": {
1641
+ "description": "Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.",
1642
+ "anyOf": [
1643
+ {
1644
+ "instanceof": "RegExp",
1645
+ "tsType": "RegExp"
1646
+ },
1647
+ {
1648
+ "type": "string"
1649
+ },
1650
+ {
1651
+ "instanceof": "Function",
1652
+ "tsType": "((module: import('../lib/Module')) => boolean)"
1653
+ }
1654
+ ]
1655
+ }
1656
+ }
1657
+ },
1499
1658
  "Library": {
1500
1659
  "description": "Make the output files a library, exporting the exports of the entry point.",
1501
1660
  "anyOf": [
@@ -2299,6 +2458,14 @@
2299
2458
  }
2300
2459
  ]
2301
2460
  },
2461
+ "minSizeReduction": {
2462
+ "description": "Minimum size reduction due to the created chunk.",
2463
+ "oneOf": [
2464
+ {
2465
+ "$ref": "#/definitions/OptimizationSplitChunksSizes"
2466
+ }
2467
+ ]
2468
+ },
2302
2469
  "name": {
2303
2470
  "description": "Give chunks for this cache group a name (chunks with equal name are merged).",
2304
2471
  "anyOf": [
@@ -2495,6 +2662,14 @@
2495
2662
  "$ref": "#/definitions/OptimizationSplitChunksSizes"
2496
2663
  }
2497
2664
  ]
2665
+ },
2666
+ "minSizeReduction": {
2667
+ "description": "Minimum size reduction due to the created chunk.",
2668
+ "oneOf": [
2669
+ {
2670
+ "$ref": "#/definitions/OptimizationSplitChunksSizes"
2671
+ }
2672
+ ]
2498
2673
  }
2499
2674
  }
2500
2675
  },
@@ -2571,6 +2746,14 @@
2571
2746
  }
2572
2747
  ]
2573
2748
  },
2749
+ "minSizeReduction": {
2750
+ "description": "Minimum size reduction due to the created chunk.",
2751
+ "oneOf": [
2752
+ {
2753
+ "$ref": "#/definitions/OptimizationSplitChunksSizes"
2754
+ }
2755
+ ]
2756
+ },
2574
2757
  "name": {
2575
2758
  "description": "Give chunks created a name (chunks with equal name are merged).",
2576
2759
  "anyOf": [
@@ -3952,20 +4135,40 @@
3952
4135
  "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.",
3953
4136
  "type": "array",
3954
4137
  "items": {
3955
- "description": "A path to a immutable directory (usually a package manager cache directory).",
3956
- "type": "string",
3957
- "absolutePath": true,
3958
- "minLength": 1
4138
+ "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.",
4139
+ "anyOf": [
4140
+ {
4141
+ "description": "A RegExp matching a immutable directory (usually a package manager cache directory, including the tailing slash)",
4142
+ "instanceof": "RegExp",
4143
+ "tsType": "RegExp"
4144
+ },
4145
+ {
4146
+ "description": "A path to a immutable directory (usually a package manager cache directory).",
4147
+ "type": "string",
4148
+ "absolutePath": true,
4149
+ "minLength": 1
4150
+ }
4151
+ ]
3959
4152
  }
3960
4153
  },
3961
4154
  "managedPaths": {
3962
4155
  "description": "List of paths that are managed by a package manager and can be trusted to not be modified otherwise.",
3963
4156
  "type": "array",
3964
4157
  "items": {
3965
- "description": "A path to a managed directory (usually a node_modules directory).",
3966
- "type": "string",
3967
- "absolutePath": true,
3968
- "minLength": 1
4158
+ "description": "List of paths that are managed by a package manager and can be trusted to not be modified otherwise.",
4159
+ "anyOf": [
4160
+ {
4161
+ "description": "A RegExp matching a managed directory (usually a node_modules directory, including the tailing slash)",
4162
+ "instanceof": "RegExp",
4163
+ "tsType": "RegExp"
4164
+ },
4165
+ {
4166
+ "description": "A path to a managed directory (usually a node_modules directory).",
4167
+ "type": "string",
4168
+ "absolutePath": true,
4169
+ "minLength": 1
4170
+ }
4171
+ ]
3969
4172
  }
3970
4173
  },
3971
4174
  "module": {
@@ -4663,7 +4866,7 @@
4663
4866
  "$ref": "#/definitions/EntryNormalized"
4664
4867
  },
4665
4868
  "experiments": {
4666
- "$ref": "#/definitions/Experiments"
4869
+ "$ref": "#/definitions/ExperimentsNormalized"
4667
4870
  },
4668
4871
  "externals": {
4669
4872
  "$ref": "#/definitions/Externals"
@@ -3,4 +3,4 @@
3
3
  * DO NOT MODIFY BY HAND.
4
4
  * Run `yarn special-lint-fix` to update
5
5
  */
6
- const o=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;function t(e,{instancePath:n="",parentData:s,parentDataProperty:l,rootData:a=e}={}){let i=null,r=0;const c=r;let p=!1,u=null;const f=r;if(r==r)if(e&&"object"==typeof e&&!Array.isArray(e)){const t=r;for(const o in e)if("cacheLocation"!==o&&"frozen"!==o&&"lockfileLocation"!==o&&"upgrade"!==o){const t={params:{additionalProperty:o}};null===i?i=[t]:i.push(t),r++;break}if(t===r){if(void 0!==e.cacheLocation){let t=e.cacheLocation;const n=r,s=r;let l=!1;const a=r;if(!1!==t){const o={params:{}};null===i?i=[o]:i.push(o),r++}var h=a===r;if(l=l||h,!l){const e=r;if(r===e)if("string"==typeof t){if(t.includes("!")||!0!==o.test(t)){const o={params:{}};null===i?i=[o]:i.push(o),r++}}else{const o={params:{type:"string"}};null===i?i=[o]:i.push(o),r++}h=e===r,l=l||h}if(l)r=s,null!==i&&(s?i.length=s:i=null);else{const o={params:{}};null===i?i=[o]:i.push(o),r++}var d=n===r}else d=!0;if(d){if(void 0!==e.frozen){const o=r;if("boolean"!=typeof e.frozen){const o={params:{type:"boolean"}};null===i?i=[o]:i.push(o),r++}d=o===r}else d=!0;if(d){if(void 0!==e.lockfileLocation){let t=e.lockfileLocation;const n=r;if(r===n)if("string"==typeof t){if(t.includes("!")||!0!==o.test(t)){const o={params:{}};null===i?i=[o]:i.push(o),r++}}else{const o={params:{type:"string"}};null===i?i=[o]:i.push(o),r++}d=n===r}else d=!0;if(d)if(void 0!==e.upgrade){const o=r;if("boolean"!=typeof e.upgrade){const o={params:{type:"boolean"}};null===i?i=[o]:i.push(o),r++}d=o===r}else d=!0}}}}else{const o={params:{type:"object"}};null===i?i=[o]:i.push(o),r++}if(f===r&&(p=!0,u=0),!p){const o={params:{passingSchemas:u}};return null===i?i=[o]:i.push(o),r++,t.errors=i,!1}return r=c,null!==i&&(c?i.length=c:i=null),t.errors=i,0===r}module.exports=t,module.exports.default=t;
6
+ const r=/^(?:[A-Za-z]:[\\/]|\\\\|\/)/;module.exports=n,module.exports.default=n;const t=new RegExp("^https?://","u");function e(n,{instancePath:o="",parentData:s,parentDataProperty:a,rootData:l=n}={}){let i=null,p=0;if(0===p){if(!n||"object"!=typeof n||Array.isArray(n))return e.errors=[{params:{type:"object"}}],!1;{let o;if(void 0===n.allowedUris&&(o="allowedUris"))return e.errors=[{params:{missingProperty:o}}],!1;{const o=p;for(const r in n)if("allowedUris"!==r&&"cacheLocation"!==r&&"frozen"!==r&&"lockfileLocation"!==r&&"upgrade"!==r)return e.errors=[{params:{additionalProperty:r}}],!1;if(o===p){if(void 0!==n.allowedUris){let r=n.allowedUris;const o=p;if(p==p){if(!Array.isArray(r))return e.errors=[{params:{type:"array"}}],!1;{const n=r.length;for(let o=0;o<n;o++){let n=r[o];const s=p,a=p;let l=!1;const f=p;if(!(n instanceof RegExp)){const r={params:{}};null===i?i=[r]:i.push(r),p++}var c=f===p;if(l=l||c,!l){const r=p;if(p===r)if("string"==typeof n){if(!t.test(n)){const r={params:{pattern:"^https?://"}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}if(c=r===p,l=l||c,!l){const r=p;if(!(n instanceof Function)){const r={params:{}};null===i?i=[r]:i.push(r),p++}c=r===p,l=l||c}}if(!l){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}if(p=a,null!==i&&(a?i.length=a:i=null),s!==p)break}}}var f=o===p}else f=!0;if(f){if(void 0!==n.cacheLocation){let t=n.cacheLocation;const o=p,s=p;let a=!1;const l=p;if(!1!==t){const r={params:{}};null===i?i=[r]:i.push(r),p++}var u=l===p;if(a=a||u,!a){const e=p;if(p===e)if("string"==typeof t){if(t.includes("!")||!0!==r.test(t)){const r={params:{}};null===i?i=[r]:i.push(r),p++}}else{const r={params:{type:"string"}};null===i?i=[r]:i.push(r),p++}u=e===p,a=a||u}if(!a){const r={params:{}};return null===i?i=[r]:i.push(r),p++,e.errors=i,!1}p=s,null!==i&&(s?i.length=s:i=null),f=o===p}else f=!0;if(f){if(void 0!==n.frozen){const r=p;if("boolean"!=typeof n.frozen)return e.errors=[{params:{type:"boolean"}}],!1;f=r===p}else f=!0;if(f){if(void 0!==n.lockfileLocation){let t=n.lockfileLocation;const o=p;if(p===o){if("string"!=typeof t)return e.errors=[{params:{type:"string"}}],!1;if(t.includes("!")||!0!==r.test(t))return e.errors=[{params:{}}],!1}f=o===p}else f=!0;if(f)if(void 0!==n.upgrade){const r=p;if("boolean"!=typeof n.upgrade)return e.errors=[{params:{type:"boolean"}}],!1;f=r===p}else f=!0}}}}}}}return e.errors=i,0===p}function n(r,{instancePath:t="",parentData:o,parentDataProperty:s,rootData:a=r}={}){let l=null,i=0;const p=i;let c=!1,f=null;const u=i;if(e(r,{instancePath:t,parentData:o,parentDataProperty:s,rootData:a})||(l=null===l?e.errors:l.concat(e.errors),i=l.length),u===i&&(c=!0,f=0),!c){const r={params:{passingSchemas:f}};return null===l?l=[r]:l.push(r),i++,n.errors=l,!1}return i=p,null!==l&&(p?l.length=p:l=null),n.errors=l,0===i}
@@ -5,6 +5,9 @@
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
+ "allowedUris": {
9
+ "$ref": "#/definitions/HttpUriOptionsAllowedUris"
10
+ },
8
11
  "cacheLocation": {
9
12
  "description": "Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.",
10
13
  "anyOf": [
@@ -30,6 +33,31 @@
30
33
  "description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.",
31
34
  "type": "boolean"
32
35
  }
36
+ },
37
+ "required": ["allowedUris"]
38
+ },
39
+ "HttpUriOptionsAllowedUris": {
40
+ "description": "List of allowed URIs (resp. the beginning of them).",
41
+ "type": "array",
42
+ "items": {
43
+ "description": "List of allowed URIs (resp. the beginning of them).",
44
+ "anyOf": [
45
+ {
46
+ "description": "Allowed URI pattern.",
47
+ "instanceof": "RegExp",
48
+ "tsType": "RegExp"
49
+ },
50
+ {
51
+ "description": "Allowed URI (resp. the beginning of it).",
52
+ "type": "string",
53
+ "pattern": "^https?://"
54
+ },
55
+ {
56
+ "description": "Allowed URI filter function.",
57
+ "instanceof": "Function",
58
+ "tsType": "((uri: string) => boolean)"
59
+ }
60
+ ]
33
61
  }
34
62
  }
35
63
  },