webpack 5.68.0 → 5.70.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/BannerPlugin.js +10 -4
- package/lib/ChunkGraph.js +1 -2
- package/lib/CleanPlugin.js +64 -18
- package/lib/Compilation.js +43 -17
- package/lib/ContextModule.js +90 -26
- package/lib/ContextModuleFactory.js +65 -21
- package/lib/EntryOptionPlugin.js +1 -0
- package/lib/ExportsInfo.js +4 -4
- package/lib/Generator.js +1 -0
- package/lib/ModuleHashingError.js +29 -0
- package/lib/NodeStuffPlugin.js +10 -0
- package/lib/NormalModule.js +21 -16
- package/lib/NormalModuleFactory.js +40 -35
- package/lib/ProgressPlugin.js +4 -5
- package/lib/RuntimeTemplate.js +1 -0
- package/lib/TemplatedPathPlugin.js +48 -23
- package/lib/WebpackOptionsApply.js +2 -0
- package/lib/asset/AssetGenerator.js +122 -33
- package/lib/buildChunkGraph.js +1 -1
- package/lib/cache/ResolverCachePlugin.js +89 -28
- package/lib/config/browserslistTargetHandler.js +3 -5
- package/lib/config/defaults.js +7 -2
- package/lib/config/normalization.js +1 -0
- package/lib/css/CssLoadingRuntimeModule.js +63 -70
- package/lib/css/CssModulesPlugin.js +2 -1
- package/lib/debug/ProfilingPlugin.js +3 -4
- package/lib/dependencies/ContextDependencyHelpers.js +1 -1
- package/lib/dependencies/ContextElementDependency.js +8 -2
- package/lib/dependencies/ExportsInfoDependency.js +6 -0
- package/lib/dependencies/HarmonyAcceptImportDependency.js +5 -3
- package/lib/dependencies/HarmonyExportInitFragment.js +4 -1
- package/lib/dependencies/ImportContextDependency.js +0 -2
- package/lib/dependencies/ImportMetaContextDependency.js +35 -0
- package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +252 -0
- package/lib/dependencies/ImportMetaContextPlugin.js +59 -0
- package/lib/dependencies/LoaderPlugin.js +2 -0
- package/lib/dependencies/RequireContextDependency.js +0 -16
- package/lib/esm/ModuleChunkLoadingRuntimeModule.js +24 -8
- package/lib/index.js +5 -0
- package/lib/javascript/JavascriptModulesPlugin.js +27 -2
- package/lib/javascript/StartupHelpers.js +3 -2
- package/lib/library/AssignLibraryPlugin.js +8 -2
- package/lib/node/NodeTargetPlugin.js +1 -0
- package/lib/node/ReadFileChunkLoadingRuntimeModule.js +22 -7
- package/lib/node/RequireChunkLoadingRuntimeModule.js +22 -7
- package/lib/optimize/ConcatenatedModule.js +10 -4
- package/lib/schemes/HttpUriPlugin.js +68 -6
- package/lib/serialization/FileMiddleware.js +44 -9
- package/lib/util/compileBooleanMatcher.js +1 -1
- package/lib/util/deterministicGrouping.js +1 -1
- package/lib/util/identifier.js +65 -44
- package/lib/util/internalSerializables.js +2 -0
- package/lib/util/nonNumericOnlyHash.js +22 -0
- package/lib/util/semver.js +17 -10
- package/lib/web/JsonpChunkLoadingRuntimeModule.js +15 -5
- package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +30 -20
- package/module.d.ts +15 -0
- package/package.json +13 -13
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +17 -1
- package/schemas/plugins/schemes/HttpUriPlugin.check.js +1 -1
- package/schemas/plugins/schemes/HttpUriPlugin.json +4 -0
- package/types.d.ts +203 -91
@@ -70,7 +70,7 @@
|
|
70
70
|
]
|
71
71
|
},
|
72
72
|
"AssetGeneratorDataUrlFunction": {
|
73
|
-
"description": "Function that executes for module and should return an DataUrl string.",
|
73
|
+
"description": "Function that executes for module and should return an DataUrl string. It can have a string as 'ident' property which contributes to the module hash.",
|
74
74
|
"instanceof": "Function",
|
75
75
|
"tsType": "((source: string | Buffer, context: { filename: string, module: import('../lib/Module') }) => string)"
|
76
76
|
},
|
@@ -496,6 +496,10 @@
|
|
496
496
|
"description": "Enable/disable creating async chunks that are loaded on demand.",
|
497
497
|
"type": "boolean"
|
498
498
|
},
|
499
|
+
"baseUri": {
|
500
|
+
"description": "Base uri for this entry.",
|
501
|
+
"type": "string"
|
502
|
+
},
|
499
503
|
"chunkLoading": {
|
500
504
|
"$ref": "#/definitions/ChunkLoading"
|
501
505
|
},
|
@@ -553,6 +557,10 @@
|
|
553
557
|
"description": "Enable/disable creating async chunks that are loaded on demand.",
|
554
558
|
"type": "boolean"
|
555
559
|
},
|
560
|
+
"baseUri": {
|
561
|
+
"description": "Base uri for this entry.",
|
562
|
+
"type": "string"
|
563
|
+
},
|
556
564
|
"chunkLoading": {
|
557
565
|
"$ref": "#/definitions/ChunkLoading"
|
558
566
|
},
|
@@ -1417,6 +1425,10 @@
|
|
1417
1425
|
"type": "string",
|
1418
1426
|
"absolutePath": true
|
1419
1427
|
},
|
1428
|
+
"proxy": {
|
1429
|
+
"description": "Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.",
|
1430
|
+
"type": "string"
|
1431
|
+
},
|
1420
1432
|
"upgrade": {
|
1421
1433
|
"description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.",
|
1422
1434
|
"type": "boolean"
|
@@ -1612,6 +1624,10 @@
|
|
1612
1624
|
"description": "Enable/disable evaluating import.meta.",
|
1613
1625
|
"type": "boolean"
|
1614
1626
|
},
|
1627
|
+
"importMetaContext": {
|
1628
|
+
"description": "Enable/disable evaluating import.meta.webpackContext.",
|
1629
|
+
"type": "boolean"
|
1630
|
+
},
|
1615
1631
|
"node": {
|
1616
1632
|
"$ref": "#/definitions/Node"
|
1617
1633
|
},
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* DO NOT MODIFY BY HAND.
|
4
4
|
* Run `yarn special-lint-fix` to update
|
5
5
|
*/
|
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
|
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&&"proxy"!==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 c=p;if(!(n instanceof RegExp)){const r={params:{}};null===i?i=[r]:i.push(r),p++}var f=c===p;if(l=l||f,!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(f=r===p,l=l||f,!l){const r=p;if(!(n instanceof Function)){const r={params:{}};null===i?i=[r]:i.push(r),p++}f=r===p,l=l||f}}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 c=o===p}else c=!0;if(c){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),c=o===p}else c=!0;if(c){if(void 0!==n.frozen){const r=p;if("boolean"!=typeof n.frozen)return e.errors=[{params:{type:"boolean"}}],!1;c=r===p}else c=!0;if(c){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}c=o===p}else c=!0;if(c){if(void 0!==n.proxy){const r=p;if("string"!=typeof n.proxy)return e.errors=[{params:{type:"string"}}],!1;c=r===p}else c=!0;if(c)if(void 0!==n.upgrade){const r=p;if("boolean"!=typeof n.upgrade)return e.errors=[{params:{type:"boolean"}}],!1;c=r===p}else c=!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 f=!1,c=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&&(f=!0,c=0),!f){const r={params:{passingSchemas:c}};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}
|
@@ -29,6 +29,10 @@
|
|
29
29
|
"type": "string",
|
30
30
|
"absolutePath": true
|
31
31
|
},
|
32
|
+
"proxy": {
|
33
|
+
"description": "Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.",
|
34
|
+
"type": "string"
|
35
|
+
},
|
32
36
|
"upgrade": {
|
33
37
|
"description": "When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.",
|
34
38
|
"type": "boolean"
|