mirror of https://github.com/webpack/webpack.git
				
				
				
			Merge pull request #17249 from webpack/fetchPriority
feat: added `fetchPriority`
This commit is contained in:
		
						commit
						5ab2935014
					
				|  | @ -81,6 +81,7 @@ | |||
|     "eval", | ||||
|     "Ewald", | ||||
|     "exitance", | ||||
|     "fetchpriority", | ||||
|     "filebase", | ||||
|     "fileoverview", | ||||
|     "filepath", | ||||
|  | @ -104,8 +105,8 @@ | |||
|     "hotupdatechunk", | ||||
|     "ident", | ||||
|     "idents", | ||||
|     "IIFE's", | ||||
|     "IIFE", | ||||
|     "IIFE's", | ||||
|     "informations", | ||||
|     "instanceof", | ||||
|     "inversed", | ||||
|  | @ -274,8 +275,8 @@ | |||
|     "webassembly", | ||||
|     "webassemblyjs", | ||||
|     "webmake", | ||||
|     "webpack's", | ||||
|     "webpack", | ||||
|     "webpack's", | ||||
|     "Xarray", | ||||
|     "Xexports", | ||||
|     "Xfactory", | ||||
|  |  | |||
|  | @ -3005,6 +3005,10 @@ export interface JavascriptParserOptions { | |||
| 	 * Enable/disable parsing "import { createRequire } from "module"" and evaluating createRequire(). | ||||
| 	 */ | ||||
| 	createRequire?: boolean | string; | ||||
| 	/** | ||||
| 	 * Specifies global fetchPriority for dynamic import. | ||||
| 	 */ | ||||
| 	dynamicImportFetchPriority?: "low" | "high" | "auto" | false; | ||||
| 	/** | ||||
| 	 * Specifies global mode for dynamic import. | ||||
| 	 */ | ||||
|  |  | |||
|  | @ -28,6 +28,7 @@ const { | |||
|  * @typedef {Object} RawChunkGroupOptions | ||||
|  * @property {number=} preloadOrder | ||||
|  * @property {number=} prefetchOrder | ||||
|  * @property {("low" | "high" | "auto")=} fetchPriority | ||||
|  */ | ||||
| 
 | ||||
| /** @typedef {RawChunkGroupOptions & { name?: string }} ChunkGroupOptions */ | ||||
|  |  | |||
|  | @ -188,6 +188,11 @@ exports.createScriptUrl = "__webpack_require__.tu"; | |||
|  */ | ||||
| exports.getTrustedTypesPolicy = "__webpack_require__.tt"; | ||||
| 
 | ||||
| /** | ||||
|  * a flag when a chunk has a fetch priority | ||||
|  */ | ||||
| exports.hasFetchPriority = "has fetch priority"; | ||||
| 
 | ||||
| /** | ||||
|  * the chunk name of the chunk with the runtime | ||||
|  */ | ||||
|  |  | |||
|  | @ -377,9 +377,10 @@ class RuntimePlugin { | |||
| 					if (withCreateScriptUrl) { | ||||
| 						set.add(RuntimeGlobals.createScriptUrl); | ||||
| 					} | ||||
| 					const withFetchPriority = set.has(RuntimeGlobals.hasFetchPriority); | ||||
| 					compilation.addRuntimeModule( | ||||
| 						chunk, | ||||
| 						new LoadScriptRuntimeModule(withCreateScriptUrl) | ||||
| 						new LoadScriptRuntimeModule(withCreateScriptUrl, withFetchPriority) | ||||
| 					); | ||||
| 					return true; | ||||
| 				}); | ||||
|  |  | |||
|  | @ -939,11 +939,29 @@ class RuntimeTemplate { | |||
| 		if (chunks.length === 1) { | ||||
| 			const chunkId = JSON.stringify(chunks[0].id); | ||||
| 			runtimeRequirements.add(RuntimeGlobals.ensureChunk); | ||||
| 			return `${RuntimeGlobals.ensureChunk}(${comment}${chunkId})`; | ||||
| 
 | ||||
| 			const fetchPriority = chunkGroup.options.fetchPriority; | ||||
| 
 | ||||
| 			if (fetchPriority) { | ||||
| 				runtimeRequirements.add(RuntimeGlobals.hasFetchPriority); | ||||
| 			} | ||||
| 
 | ||||
| 			return `${RuntimeGlobals.ensureChunk}(${comment}${chunkId}${ | ||||
| 				fetchPriority ? `, ${JSON.stringify(fetchPriority)}` : "" | ||||
| 			})`;
 | ||||
| 		} else if (chunks.length > 0) { | ||||
| 			runtimeRequirements.add(RuntimeGlobals.ensureChunk); | ||||
| 
 | ||||
| 			const fetchPriority = chunkGroup.options.fetchPriority; | ||||
| 
 | ||||
| 			if (fetchPriority) { | ||||
| 				runtimeRequirements.add(RuntimeGlobals.hasFetchPriority); | ||||
| 			} | ||||
| 
 | ||||
| 			const requireChunkId = chunk => | ||||
| 				`${RuntimeGlobals.ensureChunk}(${JSON.stringify(chunk.id)})`; | ||||
| 				`${RuntimeGlobals.ensureChunk}(${JSON.stringify(chunk.id)}${ | ||||
| 					fetchPriority ? `, ${JSON.stringify(fetchPriority)}` : "" | ||||
| 				})`;
 | ||||
| 			return `Promise.all(${comment.trim()}[${chunks | ||||
| 				.map(requireChunkId) | ||||
| 				.join(", ")}])`;
 | ||||
|  |  | |||
|  | @ -533,6 +533,7 @@ const applyJavascriptParserOptionsDefaults = ( | |||
| 	D(parserOptions, "dynamicImportMode", "lazy"); | ||||
| 	D(parserOptions, "dynamicImportPrefetch", false); | ||||
| 	D(parserOptions, "dynamicImportPreload", false); | ||||
| 	D(parserOptions, "dynamicImportFetchPriority", false); | ||||
| 	D(parserOptions, "createRequire", isNode); | ||||
| 	if (futureDefaults) D(parserOptions, "exportsPresence", "error"); | ||||
| }; | ||||
|  |  | |||
|  | @ -219,6 +219,25 @@ module.exports = class ImportMetaContextDependencyParserPlugin { | |||
| 								} | ||||
| 								break; | ||||
| 							} | ||||
| 							case "fetchPriority": { | ||||
| 								const expr = parser.evaluateExpression( | ||||
| 									/** @type {Expression} */ (prop.value) | ||||
| 								); | ||||
| 								if ( | ||||
| 									expr.isString() && | ||||
| 									["high", "low", "auto"].includes(expr.string) | ||||
| 								) { | ||||
| 									groupOptions.fetchPriority = | ||||
| 										/** @type {RawChunkGroupOptions["fetchPriority"]} */ ( | ||||
| 											expr.string | ||||
| 										); | ||||
| 								} else { | ||||
| 									errors.push( | ||||
| 										createPropertyParseError(prop, '"high"|"low"|"auto"') | ||||
| 									); | ||||
| 								} | ||||
| 								break; | ||||
| 							} | ||||
| 							case "recursive": { | ||||
| 								const recursiveExpr = parser.evaluateExpression( | ||||
| 									/** @type {Expression} */ (prop.value) | ||||
|  |  | |||
|  | @ -47,7 +47,11 @@ class ImportParserPlugin { | |||
| 			/** @type {RawChunkGroupOptions} */ | ||||
| 			const groupOptions = {}; | ||||
| 
 | ||||
| 			const { dynamicImportPreload, dynamicImportPrefetch } = this.options; | ||||
| 			const { | ||||
| 				dynamicImportPreload, | ||||
| 				dynamicImportPrefetch, | ||||
| 				dynamicImportFetchPriority | ||||
| 			} = this.options; | ||||
| 			if (dynamicImportPreload !== undefined && dynamicImportPreload !== false) | ||||
| 				groupOptions.preloadOrder = | ||||
| 					dynamicImportPreload === true ? 0 : dynamicImportPreload; | ||||
|  | @ -57,6 +61,11 @@ class ImportParserPlugin { | |||
| 			) | ||||
| 				groupOptions.prefetchOrder = | ||||
| 					dynamicImportPrefetch === true ? 0 : dynamicImportPrefetch; | ||||
| 			if ( | ||||
| 				dynamicImportFetchPriority !== undefined && | ||||
| 				dynamicImportFetchPriority !== false | ||||
| 			) | ||||
| 				groupOptions.fetchPriority = dynamicImportFetchPriority; | ||||
| 
 | ||||
| 			const { options: importOptions, errors: commentErrors } = | ||||
| 				parser.parseCommentOptions(expr.range); | ||||
|  | @ -141,6 +150,21 @@ class ImportParserPlugin { | |||
| 						); | ||||
| 					} | ||||
| 				} | ||||
| 				if (importOptions.webpackFetchPriority !== undefined) { | ||||
| 					if ( | ||||
| 						typeof importOptions.webpackFetchPriority === "string" && | ||||
| 						["high", "low", "auto"].includes(importOptions.webpackFetchPriority) | ||||
| 					) { | ||||
| 						groupOptions.fetchPriority = importOptions.webpackFetchPriority; | ||||
| 					} else { | ||||
| 						parser.state.module.addWarning( | ||||
| 							new UnsupportedFeatureWarning( | ||||
| 								`\`webpackFetchPriority\` expected true or "low", "high" or "auto", but received: ${importOptions.webpackFetchPriority}.`, | ||||
| 								expr.loc | ||||
| 							) | ||||
| 						); | ||||
| 					} | ||||
| 				} | ||||
| 				if (importOptions.webpackInclude !== undefined) { | ||||
| 					if ( | ||||
| 						!importOptions.webpackInclude || | ||||
|  |  | |||
|  | @ -11,6 +11,8 @@ const ChunkPrefetchStartupRuntimeModule = require("./ChunkPrefetchStartupRuntime | |||
| const ChunkPrefetchTriggerRuntimeModule = require("./ChunkPrefetchTriggerRuntimeModule"); | ||||
| const ChunkPreloadTriggerRuntimeModule = require("./ChunkPreloadTriggerRuntimeModule"); | ||||
| 
 | ||||
| /** @typedef {import("../Chunk")} Chunk */ | ||||
| /** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */ | ||||
| /** @typedef {import("../Compiler")} Compiler */ | ||||
| 
 | ||||
| class ChunkPrefetchPreloadPlugin { | ||||
|  | @ -43,7 +45,7 @@ class ChunkPrefetchPreloadPlugin { | |||
| 				compilation.hooks.additionalTreeRuntimeRequirements.tap( | ||||
| 					"ChunkPrefetchPreloadPlugin", | ||||
| 					(chunk, set, { chunkGraph }) => { | ||||
| 						const chunkMap = chunk.getChildIdsByOrdersMap(chunkGraph, false); | ||||
| 						const chunkMap = chunk.getChildIdsByOrdersMap(chunkGraph); | ||||
| 
 | ||||
| 						if (chunkMap.prefetch) { | ||||
| 							set.add(RuntimeGlobals.prefetchChunk); | ||||
|  |  | |||
|  | @ -24,17 +24,25 @@ class EnsureChunkRuntimeModule extends RuntimeModule { | |||
| 		const { runtimeTemplate } = this.compilation; | ||||
| 		// Check if there are non initial chunks which need to be imported using require-ensure
 | ||||
| 		if (this.runtimeRequirements.has(RuntimeGlobals.ensureChunkHandlers)) { | ||||
| 			const withFetchPriority = this.runtimeRequirements.has( | ||||
| 				RuntimeGlobals.hasFetchPriority | ||||
| 			); | ||||
| 			const handlers = RuntimeGlobals.ensureChunkHandlers; | ||||
| 			return Template.asString([ | ||||
| 				`${handlers} = {};`, | ||||
| 				"// This file contains only the entry chunk.", | ||||
| 				"// The chunk loading function for additional chunks", | ||||
| 				`${RuntimeGlobals.ensureChunk} = ${runtimeTemplate.basicFunction( | ||||
| 					"chunkId", | ||||
| 					`chunkId${withFetchPriority ? ", fetchPriority" : ""}`, | ||||
| 					[ | ||||
| 						`return Promise.all(Object.keys(${handlers}).reduce(${runtimeTemplate.basicFunction( | ||||
| 							"promises, key", | ||||
| 							[`${handlers}[key](chunkId, promises);`, "return promises;"] | ||||
| 							[ | ||||
| 								`${handlers}[key](chunkId, promises${ | ||||
| 									withFetchPriority ? ", fetchPriority" : "" | ||||
| 								});`,
 | ||||
| 								"return promises;" | ||||
| 							] | ||||
| 						)}, []));` | ||||
| 					] | ||||
| 				)};` | ||||
|  |  | |||
|  | @ -44,10 +44,12 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { | |||
| 
 | ||||
| 	/** | ||||
| 	 * @param {boolean=} withCreateScriptUrl use create script url for trusted types | ||||
| 	 * @param {boolean=} withFetchPriority use `fetchPriority` attribute | ||||
| 	 */ | ||||
| 	constructor(withCreateScriptUrl) { | ||||
| 	constructor(withCreateScriptUrl, withFetchPriority) { | ||||
| 		super("load script"); | ||||
| 		this._withCreateScriptUrl = withCreateScriptUrl; | ||||
| 		this._withFetchPriority = withFetchPriority; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
|  | @ -81,6 +83,15 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { | |||
| 			uniqueName | ||||
| 				? 'script.setAttribute("data-webpack", dataWebpackPrefix + key);' | ||||
| 				: "", | ||||
| 			this._withFetchPriority | ||||
| 				? Template.asString([ | ||||
| 						"if(fetchPriority) {", | ||||
| 						Template.indent( | ||||
| 							'script.setAttribute("fetchpriority", fetchPriority);' | ||||
| 						), | ||||
| 						"}" | ||||
| 				  ]) | ||||
| 				: "", | ||||
| 			`script.src = ${ | ||||
| 				this._withCreateScriptUrl | ||||
| 					? `${RuntimeGlobals.createScriptUrl}(url)` | ||||
|  | @ -105,53 +116,58 @@ class LoadScriptRuntimeModule extends HelperRuntimeModule { | |||
| 				? `var dataWebpackPrefix = ${JSON.stringify(uniqueName + ":")};` | ||||
| 				: "// data-webpack is not used as build has no uniqueName", | ||||
| 			"// loadScript function to load a script via script tag", | ||||
| 			`${fn} = ${runtimeTemplate.basicFunction("url, done, key, chunkId", [ | ||||
| 				"if(inProgress[url]) { inProgress[url].push(done); return; }", | ||||
| 				"var script, needAttach;", | ||||
| 				"if(key !== undefined) {", | ||||
| 				Template.indent([ | ||||
| 					'var scripts = document.getElementsByTagName("script");', | ||||
| 					"for(var i = 0; i < scripts.length; i++) {", | ||||
| 			`${fn} = ${runtimeTemplate.basicFunction( | ||||
| 				`url, done, key, chunkId${ | ||||
| 					this._withFetchPriority ? ", fetchPriority" : "" | ||||
| 				}`,
 | ||||
| 				[ | ||||
| 					"if(inProgress[url]) { inProgress[url].push(done); return; }", | ||||
| 					"var script, needAttach;", | ||||
| 					"if(key !== undefined) {", | ||||
| 					Template.indent([ | ||||
| 						"var s = scripts[i];", | ||||
| 						`if(s.getAttribute("src") == url${ | ||||
| 							uniqueName | ||||
| 								? ' || s.getAttribute("data-webpack") == dataWebpackPrefix + key' | ||||
| 								: "" | ||||
| 						}) { script = s; break; }` | ||||
| 						'var scripts = document.getElementsByTagName("script");', | ||||
| 						"for(var i = 0; i < scripts.length; i++) {", | ||||
| 						Template.indent([ | ||||
| 							"var s = scripts[i];", | ||||
| 							`if(s.getAttribute("src") == url${ | ||||
| 								uniqueName | ||||
| 									? ' || s.getAttribute("data-webpack") == dataWebpackPrefix + key' | ||||
| 									: "" | ||||
| 							}) { script = s; break; }` | ||||
| 						]), | ||||
| 						"}" | ||||
| 					]), | ||||
| 					"}" | ||||
| 				]), | ||||
| 				"}", | ||||
| 				"if(!script) {", | ||||
| 				Template.indent([ | ||||
| 					"needAttach = true;", | ||||
| 					createScript.call(code, this.chunk) | ||||
| 				]), | ||||
| 				"}", | ||||
| 				"inProgress[url] = [done];", | ||||
| 				"var onScriptComplete = " + | ||||
| 					runtimeTemplate.basicFunction( | ||||
| 						"prev, event", | ||||
| 						Template.asString([ | ||||
| 							"// avoid mem leaks in IE.", | ||||
| 							"script.onerror = script.onload = null;", | ||||
| 							"clearTimeout(timeout);", | ||||
| 							"var doneFns = inProgress[url];", | ||||
| 							"delete inProgress[url];", | ||||
| 							"script.parentNode && script.parentNode.removeChild(script);", | ||||
| 							`doneFns && doneFns.forEach(${runtimeTemplate.returningFunction( | ||||
| 								"fn(event)", | ||||
| 								"fn" | ||||
| 							)});`,
 | ||||
| 							"if(prev) return prev(event);" | ||||
| 						]) | ||||
| 					), | ||||
| 				`var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), ${loadTimeout});`, | ||||
| 				"script.onerror = onScriptComplete.bind(null, script.onerror);", | ||||
| 				"script.onload = onScriptComplete.bind(null, script.onload);", | ||||
| 				"needAttach && document.head.appendChild(script);" | ||||
| 			])};` | ||||
| 					"}", | ||||
| 					"if(!script) {", | ||||
| 					Template.indent([ | ||||
| 						"needAttach = true;", | ||||
| 						createScript.call(code, this.chunk) | ||||
| 					]), | ||||
| 					"}", | ||||
| 					"inProgress[url] = [done];", | ||||
| 					"var onScriptComplete = " + | ||||
| 						runtimeTemplate.basicFunction( | ||||
| 							"prev, event", | ||||
| 							Template.asString([ | ||||
| 								"// avoid mem leaks in IE.", | ||||
| 								"script.onerror = script.onload = null;", | ||||
| 								"clearTimeout(timeout);", | ||||
| 								"var doneFns = inProgress[url];", | ||||
| 								"delete inProgress[url];", | ||||
| 								"script.parentNode && script.parentNode.removeChild(script);", | ||||
| 								`doneFns && doneFns.forEach(${runtimeTemplate.returningFunction( | ||||
| 									"fn(event)", | ||||
| 									"fn" | ||||
| 								)});`,
 | ||||
| 								"if(prev) return prev(event);" | ||||
| 							]) | ||||
| 						), | ||||
| 					`var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), ${loadTimeout});`, | ||||
| 					"script.onerror = onScriptComplete.bind(null, script.onerror);", | ||||
| 					"script.onload = onScriptComplete.bind(null, script.onload);", | ||||
| 					"needAttach && document.head.appendChild(script);" | ||||
| 				] | ||||
| 			)};` | ||||
| 		]); | ||||
| 	} | ||||
| } | ||||
|  |  | |||
|  | @ -108,6 +108,9 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { | |||
| 		const withPreload = this._runtimeRequirements.has( | ||||
| 			RuntimeGlobals.preloadChunkHandlers | ||||
| 		); | ||||
| 		const withFetchPriority = this._runtimeRequirements.has( | ||||
| 			RuntimeGlobals.hasFetchPriority | ||||
| 		); | ||||
| 		const chunkLoadingGlobalExpr = `${globalObject}[${JSON.stringify( | ||||
| 			chunkLoadingGlobal | ||||
| 		)}]`;
 | ||||
|  | @ -138,7 +141,7 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { | |||
| 			withLoading | ||||
| 				? Template.asString([ | ||||
| 						`${fn}.j = ${runtimeTemplate.basicFunction( | ||||
| 							"chunkId, promises", | ||||
| 							`chunkId, promises${withFetchPriority ? ", fetchPriority" : ""}`, | ||||
| 							hasJsMatcher !== false | ||||
| 								? Template.indent([ | ||||
| 										"// JSONP chunk loading for javascript", | ||||
|  | @ -190,7 +193,11 @@ class JsonpChunkLoadingRuntimeModule extends RuntimeModule { | |||
| 															"}" | ||||
| 														] | ||||
| 													)};`,
 | ||||
| 													`${RuntimeGlobals.loadScript}(url, loadingEnded, "chunk-" + chunkId, chunkId);` | ||||
| 													`${ | ||||
| 														RuntimeGlobals.loadScript | ||||
| 													}(url, loadingEnded, "chunk-" + chunkId, chunkId${ | ||||
| 														withFetchPriority ? ", fetchPriority" : "" | ||||
| 													});` | ||||
| 												]), | ||||
| 												hasJsMatcher === true | ||||
| 													? "}" | ||||
|  |  | |||
|  | @ -174,6 +174,7 @@ interface ImportMeta { | |||
| 			exclude?: RegExp; | ||||
| 			preload?: boolean | number; | ||||
| 			prefetch?: boolean | number; | ||||
| 			fetchPriority?: "low" | "high" | "auto"; | ||||
| 			chunkName?: string; | ||||
| 			exports?: string | string[][]; | ||||
| 			mode?: "sync" | "eager" | "weak" | "lazy" | "lazy-once"; | ||||
|  |  | |||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -1632,6 +1632,10 @@ | |||
|             } | ||||
|           ] | ||||
|         }, | ||||
|         "dynamicImportFetchPriority": { | ||||
|           "description": "Specifies global fetchPriority for dynamic import.", | ||||
|           "enum": ["low", "high", "auto", false] | ||||
|         }, | ||||
|         "dynamicImportMode": { | ||||
|           "description": "Specifies global mode for dynamic import.", | ||||
|           "enum": ["eager", "weak", "lazy", "lazy-once"] | ||||
|  |  | |||
|  | @ -228,6 +228,7 @@ describe("snapshots", () => { | |||
| 		      }, | ||||
| 		      "javascript": Object { | ||||
| 		        "createRequire": false, | ||||
| 		        "dynamicImportFetchPriority": false, | ||||
| 		        "dynamicImportMode": "lazy", | ||||
| 		        "dynamicImportPrefetch": false, | ||||
| 		        "dynamicImportPreload": false, | ||||
|  |  | |||
|  | @ -1561,6 +1561,25 @@ Object { | |||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-auto-dynamic-import-fetch-priority": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|         "description": "Specifies global fetchPriority for dynamic import.", | ||||
|         "multiple": false, | ||||
|         "path": "module.parser.javascript/auto.dynamicImportFetchPriority", | ||||
|         "type": "enum", | ||||
|         "values": Array [ | ||||
|           "low", | ||||
|           "high", | ||||
|           "auto", | ||||
|           false, | ||||
|         ], | ||||
|       }, | ||||
|     ], | ||||
|     "description": "Specifies global fetchPriority for dynamic import.", | ||||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-auto-dynamic-import-mode": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|  | @ -2233,6 +2252,25 @@ Object { | |||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-dynamic-dynamic-import-fetch-priority": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|         "description": "Specifies global fetchPriority for dynamic import.", | ||||
|         "multiple": false, | ||||
|         "path": "module.parser.javascript/dynamic.dynamicImportFetchPriority", | ||||
|         "type": "enum", | ||||
|         "values": Array [ | ||||
|           "low", | ||||
|           "high", | ||||
|           "auto", | ||||
|           false, | ||||
|         ], | ||||
|       }, | ||||
|     ], | ||||
|     "description": "Specifies global fetchPriority for dynamic import.", | ||||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-dynamic-dynamic-import-mode": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|  | @ -2412,6 +2450,25 @@ Object { | |||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-dynamic-import-fetch-priority": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|         "description": "Specifies global fetchPriority for dynamic import.", | ||||
|         "multiple": false, | ||||
|         "path": "module.parser.javascript.dynamicImportFetchPriority", | ||||
|         "type": "enum", | ||||
|         "values": Array [ | ||||
|           "low", | ||||
|           "high", | ||||
|           "auto", | ||||
|           false, | ||||
|         ], | ||||
|       }, | ||||
|     ], | ||||
|     "description": "Specifies global fetchPriority for dynamic import.", | ||||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-dynamic-import-meta": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|  | @ -2904,6 +2961,25 @@ Object { | |||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-esm-dynamic-import-fetch-priority": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|         "description": "Specifies global fetchPriority for dynamic import.", | ||||
|         "multiple": false, | ||||
|         "path": "module.parser.javascript/esm.dynamicImportFetchPriority", | ||||
|         "type": "enum", | ||||
|         "values": Array [ | ||||
|           "low", | ||||
|           "high", | ||||
|           "auto", | ||||
|           false, | ||||
|         ], | ||||
|       }, | ||||
|     ], | ||||
|     "description": "Specifies global fetchPriority for dynamic import.", | ||||
|     "multiple": false, | ||||
|     "simpleType": "string", | ||||
|   }, | ||||
|   "module-parser-javascript-esm-dynamic-import-mode": Object { | ||||
|     "configs": Array [ | ||||
|       Object { | ||||
|  |  | |||
|  | @ -3,12 +3,12 @@ | |||
| exports[`StatsTestCases should print correct stats for aggressive-splitting-entry 1`] = ` | ||||
| "fitting: | ||||
|   PublicPath: auto | ||||
|   asset fitting-42703728faa2ac5f1783.js 16.1 KiB [emitted] [immutable] | ||||
|   asset fitting-801f5840b67f0f13ee03.js 16.2 KiB [emitted] [immutable] | ||||
|   asset fitting-50595d23e8f97d7ccd2a.js 1.9 KiB [emitted] [immutable] | ||||
|   asset fitting-5bc77880fdc9e2bf09ee.js 1.9 KiB [emitted] [immutable] | ||||
|   asset fitting-72afdc913f6cf884b457.js 1.08 KiB [emitted] [immutable] | ||||
|   Entrypoint main 19.9 KiB = fitting-50595d23e8f97d7ccd2a.js 1.9 KiB fitting-5bc77880fdc9e2bf09ee.js 1.9 KiB fitting-42703728faa2ac5f1783.js 16.1 KiB | ||||
|   chunk (runtime: main) fitting-42703728faa2ac5f1783.js 1.87 KiB (javascript) 8.67 KiB (runtime) [entry] [rendered] | ||||
|   Entrypoint main 20 KiB = fitting-50595d23e8f97d7ccd2a.js 1.9 KiB fitting-5bc77880fdc9e2bf09ee.js 1.9 KiB fitting-801f5840b67f0f13ee03.js 16.2 KiB | ||||
|   chunk (runtime: main) fitting-801f5840b67f0f13ee03.js 1.87 KiB (javascript) 8.67 KiB (runtime) [entry] [rendered] | ||||
|     > ./index main | ||||
|     runtime modules 8.67 KiB 11 modules | ||||
|     cacheable modules 1.87 KiB | ||||
|  | @ -30,12 +30,12 @@ exports[`StatsTestCases should print correct stats for aggressive-splitting-entr | |||
| 
 | ||||
| content-change: | ||||
|   PublicPath: auto | ||||
|   asset content-change-bf86f7c713e56417a7d9.js 16.1 KiB [emitted] [immutable] | ||||
|   asset content-change-0b51d1b0fa9b0275258e.js 16.2 KiB [emitted] [immutable] | ||||
|   asset content-change-50595d23e8f97d7ccd2a.js 1.9 KiB [emitted] [immutable] | ||||
|   asset content-change-5bc77880fdc9e2bf09ee.js 1.9 KiB [emitted] [immutable] | ||||
|   asset content-change-72afdc913f6cf884b457.js 1.08 KiB [emitted] [immutable] | ||||
|   Entrypoint main 20 KiB = content-change-50595d23e8f97d7ccd2a.js 1.9 KiB content-change-5bc77880fdc9e2bf09ee.js 1.9 KiB content-change-bf86f7c713e56417a7d9.js 16.1 KiB | ||||
|   chunk (runtime: main) content-change-bf86f7c713e56417a7d9.js 1.87 KiB (javascript) 8.68 KiB (runtime) [entry] [rendered] | ||||
|   Entrypoint main 20 KiB = content-change-50595d23e8f97d7ccd2a.js 1.9 KiB content-change-5bc77880fdc9e2bf09ee.js 1.9 KiB content-change-0b51d1b0fa9b0275258e.js 16.2 KiB | ||||
|   chunk (runtime: main) content-change-0b51d1b0fa9b0275258e.js 1.87 KiB (javascript) 8.68 KiB (runtime) [entry] [rendered] | ||||
|     > ./index main | ||||
|     runtime modules 8.68 KiB 11 modules | ||||
|     cacheable modules 1.87 KiB | ||||
|  | @ -58,7 +58,7 @@ content-change: | |||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for aggressive-splitting-on-demand 1`] = ` | ||||
| "PublicPath: auto | ||||
| asset 4b96d6b25c31d619b4d3.js 11.7 KiB [emitted] [immutable] (name: main) | ||||
| asset eff9501b36393dee5606.js 11.7 KiB [emitted] [immutable] (name: main) | ||||
| asset 3fc6535262efa7e4fa3b.js 1.91 KiB [emitted] [immutable] | ||||
| asset 56815935c535fbc0e462.js 1.91 KiB [emitted] [immutable] | ||||
| asset 2b8c8882bd4326b27013.js 1.9 KiB [emitted] [immutable] | ||||
|  | @ -70,12 +70,12 @@ asset f79c60cc3faba968a476.js 1.9 KiB [emitted] [immutable] | |||
| asset 7294786e49319a98f5af.js 1010 bytes [emitted] [immutable] | ||||
| asset c5861419d7f3f6ea6c19.js 1010 bytes [emitted] [immutable] | ||||
| asset f897ac9956540163d002.js 1010 bytes [emitted] [immutable] | ||||
| Entrypoint main 11.7 KiB = 4b96d6b25c31d619b4d3.js | ||||
| Entrypoint main 11.7 KiB = eff9501b36393dee5606.js | ||||
| chunk (runtime: main) 5bc77880fdc9e2bf09ee.js 1.76 KiB [rendered] [recorded] aggressive splitted | ||||
|   > ./c ./d ./e ./index.js 3:0-30 | ||||
|   ./c.js 899 bytes [built] [code generated] | ||||
|   ./d.js 899 bytes [built] [code generated] | ||||
| chunk (runtime: main) 4b96d6b25c31d619b4d3.js (main) 248 bytes (javascript) 6.33 KiB (runtime) [entry] [rendered] | ||||
| chunk (runtime: main) eff9501b36393dee5606.js (main) 248 bytes (javascript) 6.33 KiB (runtime) [entry] [rendered] | ||||
|   > ./index main | ||||
|   runtime modules 6.33 KiB 7 modules | ||||
|   ./index.js 248 bytes [built] [code generated] | ||||
|  | @ -191,9 +191,9 @@ webpack x.x.x compiled successfully in X ms" | |||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for async-commons-chunk 1`] = ` | ||||
| "chunk (runtime: main) main.js (main) 515 bytes (javascript) 6.01 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered] | ||||
| "chunk (runtime: main) main.js (main) 515 bytes (javascript) 6.02 KiB (runtime) >{460}< >{847}< >{996}< [entry] [rendered] | ||||
|   > ./ main | ||||
|   runtime modules 6.01 KiB 7 modules | ||||
|   runtime modules 6.02 KiB 7 modules | ||||
|   ./index.js 515 bytes [built] [code generated] | ||||
| chunk (runtime: main) 460.js 21 bytes <{179}> ={847}= [rendered] | ||||
|   > ./index.js 17:1-21:3 | ||||
|  | @ -318,9 +318,9 @@ vendors: | |||
|     > ./g ./a.js 6:0-47 | ||||
|     dependent modules 20 bytes [dependent] 1 module | ||||
|     ./g.js 45 bytes [built] [code generated] | ||||
|   chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) 6.66 KiB (runtime) [entry] [rendered] | ||||
|   chunk (runtime: main) vendors/main.js (main) 147 bytes (javascript) 6.67 KiB (runtime) [entry] [rendered] | ||||
|     > ./ main | ||||
|     runtime modules 6.66 KiB 9 modules | ||||
|     runtime modules 6.67 KiB 9 modules | ||||
|     ./index.js 147 bytes [built] [code generated] | ||||
|   chunk (runtime: a, b, c) vendors/vendors.js (vendors) (id hint: vendors) 60 bytes [initial] [rendered] split chunk (cache group: vendors) (name: vendors) | ||||
|     > ./a a | ||||
|  | @ -354,7 +354,7 @@ vendors: | |||
|   vendors (webpack x.x.x) compiled successfully | ||||
| 
 | ||||
| multiple-vendors: | ||||
|   Entrypoint main 11.5 KiB = multiple-vendors/main.js | ||||
|   Entrypoint main 11.6 KiB = multiple-vendors/main.js | ||||
|   Entrypoint a 15 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/954.js 412 bytes multiple-vendors/767.js 412 bytes multiple-vendors/390.js 412 bytes multiple-vendors/a.js 13.4 KiB | ||||
|   Entrypoint b 8.13 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/954.js 412 bytes multiple-vendors/767.js 412 bytes multiple-vendors/568.js 412 bytes multiple-vendors/b.js 6.52 KiB | ||||
|   Entrypoint c 8.13 KiB = multiple-vendors/libs-x.js 412 bytes multiple-vendors/769.js 412 bytes multiple-vendors/767.js 412 bytes multiple-vendors/568.js 412 bytes multiple-vendors/c.js 6.52 KiB | ||||
|  | @ -621,9 +621,9 @@ chunk (runtime: main) d_js-e_js.bundle.js 60 bytes <{c_js}> [rendered] | |||
|     cjs self exports reference ./e.js 2:0-14 | ||||
|     X ms -> X ms -> | ||||
|     X ms (resolving: X ms, restoring: X ms, integration: X ms, building: X ms, storing: X ms) | ||||
| chunk (runtime: main) bundle.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{b_js}< >{c_js}< [entry] [rendered] | ||||
| chunk (runtime: main) bundle.js (main) 73 bytes (javascript) 6.03 KiB (runtime) >{b_js}< >{c_js}< [entry] [rendered] | ||||
|   > ./index main | ||||
|   runtime modules 6.02 KiB 7 modules | ||||
|   runtime modules 6.03 KiB 7 modules | ||||
|   cacheable modules 73 bytes | ||||
|     ./a.js 22 bytes [dependent] [built] [code generated] | ||||
|       cjs self exports reference ./a.js 1:0-14 | ||||
|  | @ -640,8 +640,8 @@ webpack x.x.x compiled successfully in X ms" | |||
| exports[`StatsTestCases should print correct stats for circular-correctness 1`] = ` | ||||
| "chunk (runtime: main) 128.bundle.js (b) 49 bytes <{179}> <{459}> >{459}< [rendered] | ||||
|   ./module-b.js 49 bytes [built] [code generated] | ||||
| chunk (runtime: main) bundle.js (main) 98 bytes (javascript) 7.7 KiB (runtime) >{128}< >{786}< [entry] [rendered] | ||||
|   runtime modules 7.7 KiB 10 modules | ||||
| chunk (runtime: main) bundle.js (main) 98 bytes (javascript) 7.71 KiB (runtime) >{128}< >{786}< [entry] [rendered] | ||||
|   runtime modules 7.71 KiB 10 modules | ||||
|   ./index.js 98 bytes [built] [code generated] | ||||
| chunk (runtime: main) 459.bundle.js (c) 98 bytes <{128}> <{786}> >{128}< >{786}< [rendered] | ||||
|   ./module-c.js 98 bytes [built] [code generated] | ||||
|  | @ -751,8 +751,8 @@ exports[`StatsTestCases should print correct stats for concat-and-sideeffects 1` | |||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for context-independence 1`] = ` | ||||
| "asset main-6bdf116ffeb138753a9a.js 12.8 KiB [emitted] [immutable] (name: main) | ||||
|   sourceMap main-6bdf116ffeb138753a9a.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) | ||||
| "asset main-300a2543aac9d526a381.js 12.8 KiB [emitted] [immutable] (name: main) | ||||
|   sourceMap main-300a2543aac9d526a381.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) | ||||
| asset 695-d9846ea7920868a759cd.js 455 bytes [emitted] [immutable] | ||||
|   sourceMap 695-d9846ea7920868a759cd.js.map 347 bytes [emitted] [dev] | ||||
| runtime modules 6.61 KiB 9 modules | ||||
|  | @ -767,8 +767,8 @@ built modules 500 bytes [built] | |||
|   ./a/cc/b.js (in Xdir/context-independence/a) 18 bytes [optional] [built] [code generated] | ||||
| webpack x.x.x compiled successfully in X ms | ||||
| 
 | ||||
| asset main-6bdf116ffeb138753a9a.js 12.8 KiB [emitted] [immutable] (name: main) | ||||
|   sourceMap main-6bdf116ffeb138753a9a.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) | ||||
| asset main-300a2543aac9d526a381.js 12.8 KiB [emitted] [immutable] (name: main) | ||||
|   sourceMap main-300a2543aac9d526a381.js.map 11.1 KiB [emitted] [dev] (auxiliary name: main) | ||||
| asset 695-d9846ea7920868a759cd.js 455 bytes [emitted] [immutable] | ||||
|   sourceMap 695-d9846ea7920868a759cd.js.map 347 bytes [emitted] [dev] | ||||
| runtime modules 6.61 KiB 9 modules | ||||
|  | @ -783,7 +783,7 @@ built modules 500 bytes [built] | |||
|   ./b/cc/b.js (in Xdir/context-independence/b) 18 bytes [optional] [built] [code generated] | ||||
| webpack x.x.x compiled successfully in X ms | ||||
| 
 | ||||
| asset main-0a98b6dc7990e85a9e88.js 14.9 KiB [emitted] [immutable] (name: main) | ||||
| asset main-28a424a328c5fd8fe5bc.js 14.9 KiB [emitted] [immutable] (name: main) | ||||
| asset 695-3a54289b6e0375f1e753.js 1.51 KiB [emitted] [immutable] | ||||
| runtime modules 6.61 KiB 9 modules | ||||
| orphan modules 19 bytes [orphan] 1 module | ||||
|  | @ -797,7 +797,7 @@ built modules 500 bytes [built] | |||
|   ./a/cc/b.js (in Xdir/context-independence/a) 18 bytes [optional] [built] [code generated] | ||||
| webpack x.x.x compiled successfully in X ms | ||||
| 
 | ||||
| asset main-0a98b6dc7990e85a9e88.js 14.9 KiB [emitted] [immutable] (name: main) | ||||
| asset main-28a424a328c5fd8fe5bc.js 14.9 KiB [emitted] [immutable] (name: main) | ||||
| asset 695-3a54289b6e0375f1e753.js 1.51 KiB [emitted] [immutable] | ||||
| runtime modules 6.61 KiB 9 modules | ||||
| orphan modules 19 bytes [orphan] 1 module | ||||
|  | @ -811,7 +811,7 @@ built modules 500 bytes [built] | |||
|   ./b/cc/b.js (in Xdir/context-independence/b) 18 bytes [optional] [built] [code generated] | ||||
| webpack x.x.x compiled successfully in X ms | ||||
| 
 | ||||
| asset main-691f05a68a2fe9729db1.js 13.8 KiB [emitted] [immutable] (name: main) | ||||
| asset main-4a6f8afd60ce404bbe3a.js 13.8 KiB [emitted] [immutable] (name: main) | ||||
| asset 695-ace208366ce0ce2556ef.js 1.01 KiB [emitted] [immutable] | ||||
| runtime modules 6.61 KiB 9 modules | ||||
| orphan modules 19 bytes [orphan] 1 module | ||||
|  | @ -825,7 +825,7 @@ built modules 500 bytes [built] | |||
|   ./a/cc/b.js (in Xdir/context-independence/a) 18 bytes [optional] [built] [code generated] | ||||
| webpack x.x.x compiled successfully in X ms | ||||
| 
 | ||||
| asset main-691f05a68a2fe9729db1.js 13.8 KiB [emitted] [immutable] (name: main) | ||||
| asset main-4a6f8afd60ce404bbe3a.js 13.8 KiB [emitted] [immutable] (name: main) | ||||
| asset 695-ace208366ce0ce2556ef.js 1.01 KiB [emitted] [immutable] | ||||
| runtime modules 6.61 KiB 9 modules | ||||
| orphan modules 19 bytes [orphan] 1 module | ||||
|  | @ -1290,7 +1290,7 @@ webpack x.x.x compiled with 2 warnings in X ms" | |||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for immutable 1`] = ` | ||||
| "asset d152df65a78b496079d0.js 13.4 KiB [emitted] [immutable] (name: main) | ||||
| "asset 90957ef1deba173967c9.js 13.4 KiB [emitted] [immutable] (name: main) | ||||
| asset 22c24a3b26d46118dc06.js 809 bytes [emitted] [immutable]" | ||||
| `; | ||||
| 
 | ||||
|  | @ -1322,7 +1322,7 @@ webpack x.x.x compiled successfully in X ms" | |||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for import-weak-parser-option 1`] = ` | ||||
| "asset entry.js 13 KiB [emitted] (name: entry) | ||||
| "asset entry.js 13.1 KiB [emitted] (name: entry) | ||||
| asset 836.js 138 bytes [emitted] | ||||
| runtime modules 7.7 KiB 10 modules | ||||
| orphan modules 37 bytes [orphan] 1 module | ||||
|  | @ -1380,10 +1380,10 @@ webpack x.x.x compiled successfully in X ms | |||
| assets by chunk 895 bytes (id hint: all) | ||||
|   asset c-all-b_js-d2d64fdaadbf1936503b.js 502 bytes [emitted] [immutable] (id hint: all) | ||||
|   asset c-all-c_js-0552c7cbb8c1a12b6b9c.js 393 bytes [emitted] [immutable] (id hint: all) | ||||
| asset c-runtime~main-39696e33891b24e372db.js 13.6 KiB [emitted] [immutable] (name: runtime~main) | ||||
| asset c-runtime~main-0e3441ca5aef7c119130.js 13.6 KiB [emitted] [immutable] (name: runtime~main) | ||||
| asset c-main-463838c803f48fe97bb6.js 680 bytes [emitted] [immutable] (name: main) | ||||
| asset c-vendors-node_modules_vendor_js-7320f018dbab7e34ead5.js 185 bytes [emitted] [immutable] (id hint: vendors) | ||||
| Entrypoint main 14.7 KiB = c-runtime~main-39696e33891b24e372db.js 13.6 KiB c-all-c_js-0552c7cbb8c1a12b6b9c.js 393 bytes c-main-463838c803f48fe97bb6.js 680 bytes | ||||
| Entrypoint main 14.7 KiB = c-runtime~main-0e3441ca5aef7c119130.js 13.6 KiB c-all-c_js-0552c7cbb8c1a12b6b9c.js 393 bytes c-main-463838c803f48fe97bb6.js 680 bytes | ||||
| runtime modules 8.72 KiB 13 modules | ||||
| cacheable modules 101 bytes | ||||
|   ./c.js 61 bytes [built] [code generated] | ||||
|  | @ -1612,13 +1612,13 @@ Chunk Group b 549 bytes (21 KiB) = b.js 549 bytes (2.png 21 KiB) | |||
| chunk (runtime: main) b.js (b) 67 bytes [rendered] | ||||
|   ./node_modules/a/2.png 49 bytes [dependent] [built] [code generated] [1 asset] | ||||
|   ./node_modules/b/index.js 18 bytes [built] [code generated] | ||||
| chunk (runtime: main) main.js (main) 82 bytes (javascript) 6.3 KiB (runtime) [entry] [rendered] | ||||
|   runtime modules 6.3 KiB 8 modules | ||||
| chunk (runtime: main) main.js (main) 82 bytes (javascript) 6.31 KiB (runtime) [entry] [rendered] | ||||
|   runtime modules 6.31 KiB 8 modules | ||||
|   ./index.js 82 bytes [built] [code generated] | ||||
| chunk (runtime: main) a.js (a) 134 bytes [rendered] | ||||
|   ./node_modules/a/2.png 49 bytes [dependent] [built] [code generated] [1 asset] | ||||
|   ./node_modules/a/index.js + 1 modules 85 bytes [built] [code generated] [1 asset] | ||||
| runtime modules 6.3 KiB 8 modules | ||||
| runtime modules 6.31 KiB 8 modules | ||||
| orphan modules 49 bytes [orphan] 1 module | ||||
| modules with assets 234 bytes | ||||
|   modules by path ./node_modules/a/ 134 bytes | ||||
|  | @ -1676,9 +1676,9 @@ webpack x.x.x compiled successfully" | |||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for module-deduplication-named 1`] = ` | ||||
| "asset e1.js 12 KiB [emitted] (name: e1) | ||||
| asset e2.js 12 KiB [emitted] (name: e2) | ||||
| asset e3.js 12 KiB [emitted] (name: e3) | ||||
| "asset e1.js 12.1 KiB [emitted] (name: e1) | ||||
| asset e2.js 12.1 KiB [emitted] (name: e2) | ||||
| asset e3.js 12.1 KiB [emitted] (name: e3) | ||||
| asset async1.js 962 bytes [emitted] (name: async1) | ||||
| asset async2.js 962 bytes [emitted] (name: async2) | ||||
| asset async3.js 962 bytes [emitted] (name: async3) | ||||
|  | @ -1713,7 +1713,7 @@ webpack x.x.x compiled successfully" | |||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for module-federation-custom-exposed-module-name 1`] = ` | ||||
| "asset container_bundle.js 11.9 KiB [emitted] (name: container) | ||||
| "asset container_bundle.js 12 KiB [emitted] (name: container) | ||||
| asset custom-entry_bundle.js 414 bytes [emitted] (name: custom-entry) | ||||
| asset main_bundle.js 84 bytes [emitted] (name: main) | ||||
| runtime modules 6.6 KiB 9 modules | ||||
|  | @ -1953,7 +1953,7 @@ webpack x.x.x compiled successfully in X ms" | |||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for output-module 1`] = ` | ||||
| "asset main.mjs 9.53 KiB [emitted] [javascript module] (name: main) | ||||
| "asset main.mjs 9.54 KiB [emitted] [javascript module] (name: main) | ||||
| asset 52.mjs 356 bytes [emitted] [javascript module] | ||||
| runtime modules 5.76 KiB 7 modules | ||||
| orphan modules 38 bytes [orphan] 1 module | ||||
|  | @ -2064,7 +2064,7 @@ asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR> | |||
| asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| Entrypoint <CLR=BOLD>main</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR> | ||||
| runtime modules 6.01 KiB 7 modules | ||||
| runtime modules 6.02 KiB 7 modules | ||||
| cacheable modules 293 KiB | ||||
|   <CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|   <CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|  | @ -2081,7 +2081,7 @@ asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR> | |||
| asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| Entrypoint <CLR=BOLD>main</CLR> <CLR=33,BOLD>[big]</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR> | ||||
| runtime modules 6.01 KiB 7 modules | ||||
| runtime modules 6.02 KiB 7 modules | ||||
| cacheable modules 293 KiB | ||||
|   <CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|   <CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|  | @ -2140,7 +2140,7 @@ asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR> | |||
| asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| Entrypoint <CLR=BOLD>main</CLR> <CLR=33,BOLD>[big]</CLR> 303 KiB = <CLR=32,BOLD>main.js</CLR> | ||||
| runtime modules 6.01 KiB 7 modules | ||||
| runtime modules 6.02 KiB 7 modules | ||||
| cacheable modules 293 KiB | ||||
|   <CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|   <CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|  | @ -2248,7 +2248,7 @@ asset 460.js 323 bytes {460} [emitted] | |||
| asset 524.js 206 bytes {524} [emitted] | ||||
| asset 996.js 138 bytes {996} [emitted] | ||||
| Entrypoint main 10.3 KiB = main.js | ||||
| chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6.01 KiB (runtime) >{460}< >{996}< [entry] [rendered] | ||||
| chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{460}< >{996}< [entry] [rendered] | ||||
|   > ./index main | ||||
| chunk {460} (runtime: main) 460.js 54 bytes <{179}> >{524}< [rendered] | ||||
|   > ./c [10] ./index.js 3:0-16 | ||||
|  | @ -2256,7 +2256,7 @@ chunk {524} (runtime: main) 524.js 44 bytes <{460}> [rendered] | |||
|   > [460] ./c.js 1:0-52 | ||||
| chunk {996} (runtime: main) 996.js 22 bytes <{179}> [rendered] | ||||
|   > ./b [10] ./index.js 2:0-16 | ||||
| runtime modules 6.01 KiB | ||||
| runtime modules 6.02 KiB | ||||
|   webpack/runtime/ensure chunk 326 bytes {179} [code generated] | ||||
|     [no exports] | ||||
|     [used exports unknown] | ||||
|  | @ -2346,7 +2346,7 @@ LOG from webpack.FileSystemInfo | |||
|     Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations | ||||
|     Managed items info in cache: 0 items | ||||
| 
 | ||||
| 1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (5ca1c1296db8ec0dffb3)" | ||||
| 1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (d0ef3eec49bd8418e22c)" | ||||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for preset-errors-only 1`] = `""`; | ||||
|  | @ -2425,7 +2425,7 @@ asset main.js 10.3 KiB [emitted] (name: main) | |||
| asset 460.js 323 bytes [emitted] | ||||
| asset 524.js 206 bytes [emitted] | ||||
| asset 996.js 138 bytes [emitted] | ||||
| runtime modules 6.01 KiB 7 modules | ||||
| runtime modules 6.02 KiB 7 modules | ||||
| cacheable modules 193 bytes | ||||
|   ./index.js 51 bytes [built] [code generated] | ||||
|   ./a.js 22 bytes [built] [code generated] | ||||
|  | @ -2448,7 +2448,7 @@ exports[`StatsTestCases should print correct stats for preset-normal-performance | |||
| asset <CLR=32,BOLD>460.js</CLR> 323 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| asset <CLR=32,BOLD>524.js</CLR> 206 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| asset <CLR=32,BOLD>996.js</CLR> 138 bytes <CLR=32,BOLD>[emitted]</CLR> | ||||
| runtime modules 6.01 KiB 7 modules | ||||
| runtime modules 6.02 KiB 7 modules | ||||
| cacheable modules 293 KiB | ||||
|   <CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|   <CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|  | @ -2476,7 +2476,7 @@ exports[`StatsTestCases should print correct stats for preset-normal-performance | |||
| asset <CLR=32,BOLD>460.js</CLR> 355 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset | ||||
| asset <CLR=32,BOLD>524.js</CLR> 238 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset | ||||
| asset <CLR=32,BOLD>996.js</CLR> 170 bytes <CLR=32,BOLD>[emitted]</CLR> 1 related asset | ||||
| runtime modules 6.01 KiB 7 modules | ||||
| runtime modules 6.02 KiB 7 modules | ||||
| cacheable modules 293 KiB | ||||
|   <CLR=BOLD>./index.js</CLR> 52 bytes <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|   <CLR=BOLD>./a.js</CLR> 293 KiB <CLR=33,BOLD>[built]</CLR> <CLR=33,BOLD>[code generated]</CLR> | ||||
|  | @ -2524,9 +2524,9 @@ asset 460.js 323 bytes {460} [emitted] | |||
| asset 524.js 206 bytes {524} [emitted] | ||||
| asset 996.js 138 bytes {996} [emitted] | ||||
| Entrypoint main 10.3 KiB = main.js | ||||
| chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6.01 KiB (runtime) >{460}< >{996}< [entry] [rendered] | ||||
| chunk {179} (runtime: main) main.js (main) 73 bytes (javascript) 6.02 KiB (runtime) >{460}< >{996}< [entry] [rendered] | ||||
|   > ./index main | ||||
|   runtime modules 6.01 KiB | ||||
|   runtime modules 6.02 KiB | ||||
|     webpack/runtime/ensure chunk 326 bytes {179} [code generated] | ||||
|       [no exports] | ||||
|       [used exports unknown] | ||||
|  | @ -2722,7 +2722,7 @@ LOG from webpack.FileSystemInfo | |||
|     Directory info in cache: 0 timestamps 0 hashes 0 timestamp hash combinations | ||||
|     Managed items info in cache: 0 items | ||||
| 
 | ||||
| 1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (5ca1c1296db8ec0dffb3)" | ||||
| 1970-04-20 12:42:42: webpack x.x.x compiled successfully in X ms (d0ef3eec49bd8418e22c)" | ||||
| `; | ||||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for real-content-hash 1`] = ` | ||||
|  | @ -3004,7 +3004,7 @@ exports[`StatsTestCases should print correct stats for runtime-chunk-integration | |||
|   asset without-505.js 1.2 KiB [emitted] | ||||
|   asset without-main1.js 815 bytes [emitted] (name: main1) | ||||
|   Entrypoint main1 12.9 KiB = without-runtime.js 12.1 KiB without-main1.js 815 bytes | ||||
|   runtime modules 7.56 KiB 10 modules | ||||
|   runtime modules 7.57 KiB 10 modules | ||||
|   cacheable modules 126 bytes | ||||
|     ./main1.js 66 bytes [built] [code generated] | ||||
|     ./b.js 20 bytes [built] [code generated] | ||||
|  | @ -3066,8 +3066,8 @@ webpack x.x.x compiled successfully" | |||
| 
 | ||||
| exports[`StatsTestCases should print correct stats for runtime-specific-used-exports 1`] = ` | ||||
| "production: | ||||
|   asset production-a.js 13.1 KiB [emitted] (name: a) | ||||
|   asset production-b.js 13.1 KiB [emitted] (name: b) | ||||
|   asset production-a.js 13.2 KiB [emitted] (name: a) | ||||
|   asset production-b.js 13.2 KiB [emitted] (name: b) | ||||
|   asset production-dw_js-_a6170.js 1.15 KiB [emitted] | ||||
|   asset production-dw_js-_a6171.js 1.15 KiB [emitted] | ||||
|   asset production-dx_js.js 1.15 KiB [emitted] | ||||
|  | @ -3148,15 +3148,15 @@ exports[`StatsTestCases should print correct stats for runtime-specific-used-exp | |||
|   production (webpack x.x.x) compiled successfully in X ms | ||||
| 
 | ||||
| development: | ||||
|   asset development-a.js 15.8 KiB [emitted] (name: a) | ||||
|   asset development-b.js 15.8 KiB [emitted] (name: b) | ||||
|   asset development-a.js 15.9 KiB [emitted] (name: a) | ||||
|   asset development-b.js 15.9 KiB [emitted] (name: b) | ||||
|   asset development-dw_js.js 2.09 KiB [emitted] | ||||
|   asset development-dx_js.js 2.09 KiB [emitted] | ||||
|   asset development-dy_js.js 2.09 KiB [emitted] | ||||
|   asset development-dz_js.js 2.09 KiB [emitted] | ||||
|   asset development-c.js 1.13 KiB [emitted] (name: c) | ||||
|   chunk (runtime: a) development-a.js (a) 605 bytes (javascript) 6.59 KiB (runtime) [entry] [rendered] | ||||
|     runtime modules 6.59 KiB 9 modules | ||||
|   chunk (runtime: a) development-a.js (a) 605 bytes (javascript) 6.6 KiB (runtime) [entry] [rendered] | ||||
|     runtime modules 6.6 KiB 9 modules | ||||
|     cacheable modules 605 bytes | ||||
|       ./a.js 261 bytes [built] [code generated] | ||||
|         [used exports unknown] | ||||
|  | @ -3168,8 +3168,8 @@ development: | |||
|         [used exports unknown] | ||||
|       ./reexport.js 37 bytes [dependent] [built] [code generated] | ||||
|         [used exports unknown] | ||||
|   chunk (runtime: b) development-b.js (b) 605 bytes (javascript) 6.59 KiB (runtime) [entry] [rendered] | ||||
|     runtime modules 6.59 KiB 9 modules | ||||
|   chunk (runtime: b) development-b.js (b) 605 bytes (javascript) 6.6 KiB (runtime) [entry] [rendered] | ||||
|     runtime modules 6.6 KiB 9 modules | ||||
|     cacheable modules 605 bytes | ||||
|       ./b.js 261 bytes [built] [code generated] | ||||
|         [used exports unknown] | ||||
|  | @ -3365,7 +3365,7 @@ cacheable modules 807 bytes | |||
| webpack x.x.x compiled successfully in X ms | ||||
| 
 | ||||
| Entrypoint first 13.7 KiB = b-vendor.js 417 bytes b-first.js 13.3 KiB | ||||
| Entrypoint second 13.5 KiB = b-vendor.js 417 bytes b-second.js 13.1 KiB | ||||
| Entrypoint second 13.6 KiB = b-vendor.js 417 bytes b-second.js 13.1 KiB | ||||
| runtime modules 15.2 KiB 20 modules | ||||
| cacheable modules 975 bytes | ||||
|   code generated modules 857 bytes [code generated] | ||||
|  | @ -3909,7 +3909,7 @@ custom-chunks-filter: | |||
| 
 | ||||
| custom-chunks-filter-in-cache-groups: | ||||
|   Entrypoint main 11.3 KiB = custom-chunks-filter-in-cache-groups/main.js | ||||
|   Entrypoint a 14.6 KiB = custom-chunks-filter-in-cache-groups/176.js 860 bytes custom-chunks-filter-in-cache-groups/a.js 13.7 KiB | ||||
|   Entrypoint a 14.6 KiB = custom-chunks-filter-in-cache-groups/176.js 860 bytes custom-chunks-filter-in-cache-groups/a.js 13.8 KiB | ||||
|   Entrypoint b 8.44 KiB = custom-chunks-filter-in-cache-groups/vendors.js 1.05 KiB custom-chunks-filter-in-cache-groups/b.js 7.39 KiB | ||||
|   Entrypoint c 8.44 KiB = custom-chunks-filter-in-cache-groups/vendors.js 1.05 KiB custom-chunks-filter-in-cache-groups/c.js 7.39 KiB | ||||
|   chunk (runtime: b) custom-chunks-filter-in-cache-groups/b.js (b) 156 bytes (javascript) 2.76 KiB (runtime) ={216}= [entry] [rendered] | ||||
|  |  | |||
|  | @ -0,0 +1 @@ | |||
| export default "a"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "b"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "c"; | ||||
|  | @ -180,6 +180,13 @@ if (process.env.NODE_ENV === "production") { | |||
| 			} | ||||
| 		); | ||||
| 	}); | ||||
| 	it("should be able to load with webpackFetchPriorty high, low and auto", function () { | ||||
| 		return Promise.all([ | ||||
| 			import(/* webpackFetchPriority: "high"*/ "./dir14/a"), | ||||
| 			import(/* webpackFetchPriority: "low"*/ "./dir14/b"), | ||||
| 			import(/* webpackFetchPriority: "auto"*/ "./dir14/c"), | ||||
| 		]) | ||||
| 	}) | ||||
| } | ||||
| 
 | ||||
| function testChunkLoading(load, expectedSyncInitial, expectedSyncRequested) { | ||||
|  |  | |||
|  | @ -0,0 +1,6 @@ | |||
| export default function() { | ||||
| 	import(/* webpackPrefetch: true */ "./a"); | ||||
| 	import(/* webpackPreload: true */ "./b"); | ||||
| 	import(/* webpackPrefetch: 10, webpackFetchPriority: "low" */ "./c"); | ||||
| } | ||||
| 
 | ||||
|  | @ -0,0 +1 @@ | |||
| export default "b"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "c"; | ||||
|  | @ -0,0 +1,3 @@ | |||
| export default function test() { | ||||
| 	import("./d1"); | ||||
| } | ||||
|  | @ -0,0 +1,3 @@ | |||
| export default function test() { | ||||
| 	import("./d2"); | ||||
| } | ||||
|  | @ -0,0 +1,3 @@ | |||
| export default function test() { | ||||
| 	import(/* webpackFetchPriority: "high" */ "./d3"); | ||||
| } | ||||
|  | @ -0,0 +1 @@ | |||
| export default "d3"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "e"; | ||||
|  | @ -0,0 +1,42 @@ | |||
| it("should set fetchPriority", () => { | ||||
| 	import(/* webpackFetchPriority: "high" */ "./a"); | ||||
| 	expect(document.head._children).toHaveLength(4); | ||||
| 	const script1 = document.head._children[2]; | ||||
| 	expect(script1._attributes.fetchpriority).toBe("high"); | ||||
| 
 | ||||
| 	import(/* webpackFetchPriority: "low" */ "./b"); | ||||
| 	expect(document.head._children).toHaveLength(5); | ||||
| 	const script2 = document.head._children[4]; | ||||
| 	expect(script2._attributes.fetchpriority).toBe("low"); | ||||
| 
 | ||||
| 	import(/* webpackFetchPriority: "low" */ "./c"); | ||||
| 	expect(document.head._children).toHaveLength(6); | ||||
| 	const script3 = document.head._children[5]; | ||||
| 	expect(script3._attributes.fetchpriority).toBe("low"); | ||||
| 
 | ||||
| 	import(/* webpackPrefetch: 20, webpackFetchPriority: "auto" */ "./c"); | ||||
| 
 | ||||
| 	import("./d") | ||||
| 	expect(document.head._children).toHaveLength(7); | ||||
| 	const script4 = document.head._children[6]; | ||||
| 	expect(script4._attributes.fetchpriority).toBeUndefined(); | ||||
| 
 | ||||
| 	import(/* webpackPrefetch: -20 */ "./d3"); | ||||
| 	expect(document.head._children).toHaveLength(8); | ||||
| 	const script5 = document.head._children[7]; | ||||
| 	expect(script5._attributes.fetchpriority).toBeUndefined(); | ||||
| 
 | ||||
| 	const condition = true; | ||||
| 
 | ||||
| 	if (!condition) { | ||||
| 		import(/* webpackFetchPriority: "high", webpackChunkName: "one" */ "./e"); | ||||
| 		expect(document.head._children).toHaveLength(9); | ||||
| 		const script6 = document.head._children[8]; | ||||
| 		expect(script6._attributes.fetchpriority).toBe("high"); | ||||
| 	} else { | ||||
| 		import(/* webpackFetchPriority: "low", webpackChunkName: "two" */ "./e"); | ||||
| 		expect(document.head._children).toHaveLength(9); | ||||
| 		const script6 = document.head._children[8]; | ||||
| 		expect(script6._attributes.fetchpriority).toBe("low"); | ||||
| 	} | ||||
| }); | ||||
|  | @ -0,0 +1,26 @@ | |||
| /** @type {import("../../../../").Configuration} */ | ||||
| module.exports = { | ||||
| 	target: "web", | ||||
| 	output: { | ||||
| 		chunkFilename: "[name].js", | ||||
| 		crossOriginLoading: "anonymous" | ||||
| 	}, | ||||
| 	optimization: { | ||||
| 		minimize: false, | ||||
| 		splitChunks: { | ||||
| 			minSize: 1 | ||||
| 		} | ||||
| 	}, | ||||
| 	module: { | ||||
| 		rules: [ | ||||
| 			{ | ||||
| 				test: /d\.js$/, | ||||
| 				parser: { | ||||
| 					javascript: { | ||||
| 						dynamicImportFetchPriority: "low" | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		] | ||||
| 	} | ||||
| }; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "a"; | ||||
|  | @ -0,0 +1,3 @@ | |||
| import * as shared from './shared'; | ||||
| console.log(shared); | ||||
| export default "b"; | ||||
|  | @ -0,0 +1,3 @@ | |||
| import * as shared from './shared'; | ||||
| console.log(shared); | ||||
| export default "b"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "c"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "d"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "a"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "b"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "e"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "f"; | ||||
|  | @ -0,0 +1 @@ | |||
| export default 'g'; | ||||
|  | @ -0,0 +1 @@ | |||
| export default 'h'; | ||||
|  | @ -0,0 +1 @@ | |||
| export default 'i'; | ||||
|  | @ -0,0 +1,75 @@ | |||
| it("should set fetchPriority", () => { | ||||
| 	// Single Chunk
 | ||||
| 	import(/* webpackFetchPriority: "high" */ "./a"); | ||||
| 	expect(document.head._children).toHaveLength(1); | ||||
| 	const script1 = document.head._children[0]; | ||||
| 	expect(script1._attributes.fetchpriority).toBe("high"); | ||||
| 
 | ||||
| 	// Multiple Chunks
 | ||||
| 	import(/* webpackFetchPriority: "high" */ "./b"); | ||||
| 	import(/* webpackFetchPriority: "high" */ "./b2"); | ||||
| 	expect(document.head._children).toHaveLength(4); | ||||
| 	const script2 = document.head._children[1]; | ||||
| 	const script3 = document.head._children[2]; | ||||
| 	const script4 = document.head._children[3]; | ||||
| 	expect(script2._attributes.fetchpriority).toBe("high"); | ||||
| 	expect(script3._attributes.fetchpriority).toBe("high"); | ||||
| 	expect(script4._attributes.fetchpriority).toBe("high"); | ||||
| 
 | ||||
| 	// Single Chunk, low
 | ||||
| 	import(/* webpackFetchPriority: "low" */ "./c"); | ||||
| 	expect(document.head._children).toHaveLength(5); | ||||
| 	const script5 = document.head._children[4]; | ||||
| 	expect(script5._attributes.fetchpriority).toBe("low"); | ||||
| 
 | ||||
| 	// Single Chunk, auto
 | ||||
| 	import(/* webpackFetchPriority: "auto" */ "./d"); | ||||
| 	expect(document.head._children).toHaveLength(6); | ||||
| 	const script6 = document.head._children[5]; | ||||
| 	expect(script6._attributes.fetchpriority).toBe("auto"); | ||||
| 
 | ||||
| 	// No fetch priority
 | ||||
| 	import("./e"); | ||||
| 	expect(document.head._children).toHaveLength(7); | ||||
| 	const script7 = document.head._children[6]; | ||||
| 	expect(script7._attributes.fetchpriority).toBeUndefined(); | ||||
| 
 | ||||
| 	// Webpack context
 | ||||
| 	const loader = import.meta.webpackContext("./dir", { | ||||
| 		mode: "lazy", | ||||
| 		fetchPriority: "high" | ||||
| 	}); | ||||
| 	loader("./a"); | ||||
| 	expect(document.head._children).toHaveLength(8); | ||||
| 	const script8 = document.head._children[7]; | ||||
| 	expect(script8._attributes.fetchpriority).toBeUndefined(); | ||||
| 
 | ||||
| 	import(/* webpackFetchPriority: "auto" */ "./g"); | ||||
| 	expect(document.head._children).toHaveLength(9); | ||||
| 	const script9 = document.head._children[8]; | ||||
| 	expect(script9._attributes.fetchpriority).toBe("auto"); | ||||
| 
 | ||||
| 	import(/* webpackFetchPriority: "unknown" */ "./h.js"); | ||||
| 	expect(document.head._children).toHaveLength(10); | ||||
| 	const script10 = document.head._children[9]; | ||||
| 	expect(script10._attributes.fetchpriority).toBeUndefined(); | ||||
| 
 | ||||
| 	import(/* webpackFetchPriority: "high" */ "./i"); | ||||
| 	import(/* webpackFetchPriority: "low" */ "./i"); | ||||
| 	expect(document.head._children).toHaveLength(11); | ||||
| 	const script11 = document.head._children[10]; | ||||
| 	expect(script11._attributes.fetchpriority).toBe("high"); | ||||
| 
 | ||||
| 	import(/* webpackFetchPriority: "low" */ "./j"); | ||||
| 	import(/* webpackFetchPriority: "high" */ "./j"); | ||||
| 	expect(document.head._children).toHaveLength(12); | ||||
| 	const script12 = document.head._children[11]; | ||||
| 
 | ||||
| 	expect(script12._attributes.fetchpriority).toBe("low"); | ||||
| 	import(/* webpackFetchPriority: "low" */ "./k"); | ||||
| 	import("./e"); | ||||
| 	import(/* webpackFetchPriority: "high" */ "./k"); | ||||
| 	expect(document.head._children).toHaveLength(13); | ||||
| 	const script13 = document.head._children[12]; | ||||
| 	expect(script13._attributes.fetchpriority).toBe("low"); | ||||
| }) | ||||
|  | @ -0,0 +1 @@ | |||
| export default 'j'; | ||||
|  | @ -0,0 +1 @@ | |||
| export default 'k'; | ||||
|  | @ -0,0 +1 @@ | |||
| export default "shared"; | ||||
|  | @ -0,0 +1,3 @@ | |||
| module.exports = [ | ||||
| 	[/`webpackFetchPriority` expected true or "low", "high" or "auto"/] | ||||
| ]; | ||||
|  | @ -0,0 +1,14 @@ | |||
| /** @type {import("../../../../").Configuration} */ | ||||
| module.exports = { | ||||
| 	target: "web", | ||||
| 	output: { | ||||
| 		chunkFilename: "[name].js", | ||||
| 		crossOriginLoading: "anonymous" | ||||
| 	}, | ||||
| 	optimization: { | ||||
| 		minimize: false, | ||||
| 		splitChunks: { | ||||
| 			minSize: 1 | ||||
| 		} | ||||
| 	} | ||||
| }; | ||||
|  | @ -6013,6 +6013,11 @@ declare interface JavascriptParserOptions { | |||
| 	 */ | ||||
| 	createRequire?: string | boolean; | ||||
| 
 | ||||
| 	/** | ||||
| 	 * Specifies global fetchPriority for dynamic import. | ||||
| 	 */ | ||||
| 	dynamicImportFetchPriority?: false | "auto" | "low" | "high"; | ||||
| 
 | ||||
| 	/** | ||||
| 	 * Specifies global mode for dynamic import. | ||||
| 	 */ | ||||
|  | @ -6823,7 +6828,7 @@ declare interface LoadScriptCompilationHooks { | |||
| 	createScript: SyncWaterfallHook<[string, Chunk]>; | ||||
| } | ||||
| declare class LoadScriptRuntimeModule extends HelperRuntimeModule { | ||||
| 	constructor(withCreateScriptUrl?: boolean); | ||||
| 	constructor(withCreateScriptUrl?: boolean, withFetchPriority?: boolean); | ||||
| 	static getCompilationHooks( | ||||
| 		compilation: Compilation | ||||
| 	): LoadScriptCompilationHooks; | ||||
|  | @ -9900,6 +9905,7 @@ declare interface ProvidesObject { | |||
| declare interface RawChunkGroupOptions { | ||||
| 	preloadOrder?: number; | ||||
| 	prefetchOrder?: number; | ||||
| 	fetchPriority?: "auto" | "low" | "high"; | ||||
| } | ||||
| type RawLoaderDefinition< | ||||
| 	OptionsType = {}, | ||||
|  | @ -13374,6 +13380,7 @@ declare namespace exports { | |||
| 		export let createScript: "__webpack_require__.ts"; | ||||
| 		export let createScriptUrl: "__webpack_require__.tu"; | ||||
| 		export let getTrustedTypesPolicy: "__webpack_require__.tt"; | ||||
| 		export let hasFetchPriority: "has fetch priority"; | ||||
| 		export let chunkName: "__webpack_require__.cn"; | ||||
| 		export let runtimeId: "__webpack_require__.j"; | ||||
| 		export let getChunkScriptFilename: "__webpack_require__.u"; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue