mirror of https://github.com/webpack/webpack.git
Compare commits
25 Commits
eaa44e9de2
...
c076c7b94d
Author | SHA1 | Date |
---|---|---|
|
c076c7b94d | |
|
b6c781a0f1 | |
|
a8d39c0cdf | |
|
57bb97cbb5 | |
|
9e28ba7a71 | |
|
3c30c24d8f | |
|
37632364c5 | |
|
719e2b13ca | |
|
0e3dfa1a38 | |
|
e7c0382087 | |
|
e97ae49459 | |
|
a47f4443d1 | |
|
c94b2e9a1b | |
|
4aaaf13071 | |
|
43e8a85399 | |
|
9532eea79c | |
|
fb8bd910f0 | |
|
9c1e12dc02 | |
|
5c9de0cd72 | |
|
ceac24b37f | |
|
42b9e8462f | |
|
5d233d5389 | |
|
4cab6a07d5 | |
|
979b7f81e0 | |
|
1e70bf7d49 |
|
@ -90,6 +90,7 @@
|
||||||
"externref",
|
"externref",
|
||||||
"fetchpriority",
|
"fetchpriority",
|
||||||
"filebase",
|
"filebase",
|
||||||
|
"flac",
|
||||||
"fileoverview",
|
"fileoverview",
|
||||||
"filepath",
|
"filepath",
|
||||||
"finalizer",
|
"finalizer",
|
||||||
|
|
|
@ -312,6 +312,11 @@ module.exports.nodeModuleDecorator = "__webpack_require__.nmd";
|
||||||
*/
|
*/
|
||||||
module.exports.onChunksLoaded = "__webpack_require__.O";
|
module.exports.onChunksLoaded = "__webpack_require__.O";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the asset prefetch function
|
||||||
|
*/
|
||||||
|
module.exports.prefetchAsset = "__webpack_require__.PA";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the chunk prefetch function
|
* the chunk prefetch function
|
||||||
*/
|
*/
|
||||||
|
@ -322,6 +327,11 @@ module.exports.prefetchChunk = "__webpack_require__.E";
|
||||||
*/
|
*/
|
||||||
module.exports.prefetchChunkHandlers = "__webpack_require__.F";
|
module.exports.prefetchChunkHandlers = "__webpack_require__.F";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the asset preload function
|
||||||
|
*/
|
||||||
|
module.exports.preloadAsset = "__webpack_require__.LA";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the chunk preload function
|
* the chunk preload function
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -34,6 +34,8 @@ const WebpackIsIncludedPlugin = require("./WebpackIsIncludedPlugin");
|
||||||
|
|
||||||
const AssetModulesPlugin = require("./asset/AssetModulesPlugin");
|
const AssetModulesPlugin = require("./asset/AssetModulesPlugin");
|
||||||
|
|
||||||
|
const AssetResourcePrefetchPlugin = require("./asset/AssetResourcePrefetchPlugin");
|
||||||
|
|
||||||
const InferAsyncModulesPlugin = require("./async-modules/InferAsyncModulesPlugin");
|
const InferAsyncModulesPlugin = require("./async-modules/InferAsyncModulesPlugin");
|
||||||
|
|
||||||
const ResolverCachePlugin = require("./cache/ResolverCachePlugin");
|
const ResolverCachePlugin = require("./cache/ResolverCachePlugin");
|
||||||
|
@ -200,6 +202,21 @@ class WebpackOptionsApply extends OptionsApply {
|
||||||
|
|
||||||
new ChunkPrefetchPreloadPlugin().apply(compiler);
|
new ChunkPrefetchPreloadPlugin().apply(compiler);
|
||||||
|
|
||||||
|
// Apply AssetResourcePrefetchPlugin only for web targets or universal targets
|
||||||
|
// Check if we're targeting web environment
|
||||||
|
const externalsPresets = options.externalsPresets || {};
|
||||||
|
const isTargetingWeb = Boolean(
|
||||||
|
externalsPresets.web ||
|
||||||
|
externalsPresets.webAsync ||
|
||||||
|
externalsPresets.electronRenderer
|
||||||
|
);
|
||||||
|
|
||||||
|
// Apply the plugin if we're targeting web environment
|
||||||
|
// For universal targets (["web", "node"]), the runtime module will handle platform detection using isNeutralPlatform
|
||||||
|
if (isTargetingWeb || !externalsPresets.node) {
|
||||||
|
new AssetResourcePrefetchPlugin().apply(compiler);
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof options.output.chunkFormat === "string") {
|
if (typeof options.output.chunkFormat === "string") {
|
||||||
switch (options.output.chunkFormat) {
|
switch (options.output.chunkFormat) {
|
||||||
case "array-push": {
|
case "array-push": {
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||||
|
const ResourcePrefetchRuntimeModule = require("../prefetch/ResourcePrefetchRuntimeModule");
|
||||||
|
|
||||||
|
/** @typedef {import("../Compiler")} Compiler */
|
||||||
|
|
||||||
|
const PLUGIN_NAME = "AssetResourcePrefetchPlugin";
|
||||||
|
|
||||||
|
class AssetResourcePrefetchPlugin {
|
||||||
|
/**
|
||||||
|
* @param {Compiler} compiler the compiler
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
apply(compiler) {
|
||||||
|
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
|
||||||
|
// prefetchAsset
|
||||||
|
compilation.hooks.runtimeRequirementInTree
|
||||||
|
.for(RuntimeGlobals.prefetchAsset)
|
||||||
|
.tap(PLUGIN_NAME, (chunk, set) => {
|
||||||
|
set.add(RuntimeGlobals.publicPath);
|
||||||
|
set.add(RuntimeGlobals.require);
|
||||||
|
set.add(RuntimeGlobals.baseURI);
|
||||||
|
set.add(RuntimeGlobals.relativeUrl);
|
||||||
|
compilation.addRuntimeModule(
|
||||||
|
chunk,
|
||||||
|
new ResourcePrefetchRuntimeModule("prefetch")
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
// preloadAsset
|
||||||
|
compilation.hooks.runtimeRequirementInTree
|
||||||
|
.for(RuntimeGlobals.preloadAsset)
|
||||||
|
.tap(PLUGIN_NAME, (chunk, set) => {
|
||||||
|
set.add(RuntimeGlobals.publicPath);
|
||||||
|
set.add(RuntimeGlobals.require);
|
||||||
|
set.add(RuntimeGlobals.baseURI);
|
||||||
|
set.add(RuntimeGlobals.relativeUrl);
|
||||||
|
compilation.addRuntimeModule(
|
||||||
|
chunk,
|
||||||
|
new ResourcePrefetchRuntimeModule("preload")
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = AssetResourcePrefetchPlugin;
|
|
@ -15,59 +15,46 @@ const browserslist = require("browserslist");
|
||||||
// [[C:]/path/to/config][:env]
|
// [[C:]/path/to/config][:env]
|
||||||
const inputRx = /^(?:((?:[A-Z]:)?[/\\].*?))?(?::(.+?))?$/i;
|
const inputRx = /^(?:((?:[A-Z]:)?[/\\].*?))?(?::(.+?))?$/i;
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {object} BrowserslistHandlerConfig
|
|
||||||
* @property {string=} configPath
|
|
||||||
* @property {string=} env
|
|
||||||
* @property {string=} query
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string | null | undefined} input input string
|
|
||||||
* @param {string} context the context directory
|
|
||||||
* @returns {BrowserslistHandlerConfig} config
|
|
||||||
*/
|
|
||||||
const parse = (input, context) => {
|
|
||||||
if (!input) {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (path.isAbsolute(input)) {
|
|
||||||
const [, configPath, env] = inputRx.exec(input) || [];
|
|
||||||
return { configPath, env };
|
|
||||||
}
|
|
||||||
|
|
||||||
const config = browserslist.findConfig(context);
|
|
||||||
|
|
||||||
if (config && Object.keys(config).includes(input)) {
|
|
||||||
return { env: input };
|
|
||||||
}
|
|
||||||
|
|
||||||
return { query: input };
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string | null | undefined} input input string
|
* @param {string | null | undefined} input input string
|
||||||
* @param {string} context the context directory
|
* @param {string} context the context directory
|
||||||
* @returns {string[] | undefined} selected browsers
|
* @returns {string[] | undefined} selected browsers
|
||||||
*/
|
*/
|
||||||
const load = (input, context) => {
|
const load = (input, context) => {
|
||||||
const { configPath, env, query } = parse(input, context);
|
// browserslist:path-to-config
|
||||||
|
// browserslist:path-to-config:env
|
||||||
|
if (input && path.isAbsolute(input)) {
|
||||||
|
const [, configPath, env] = inputRx.exec(input) || [];
|
||||||
|
|
||||||
// if a query is specified, then use it, else
|
const config = browserslist.loadConfig({
|
||||||
// if a path to a config is specified then load it, else
|
|
||||||
// find a nearest config
|
|
||||||
const config =
|
|
||||||
query ||
|
|
||||||
(configPath
|
|
||||||
? browserslist.loadConfig({
|
|
||||||
config: configPath,
|
config: configPath,
|
||||||
env
|
env
|
||||||
})
|
});
|
||||||
: browserslist.loadConfig({ path: context, env }));
|
|
||||||
|
|
||||||
if (!config) return;
|
return browserslist(config, { env });
|
||||||
return browserslist(config);
|
}
|
||||||
|
|
||||||
|
const env = input || undefined;
|
||||||
|
|
||||||
|
const config = browserslist.loadConfig({
|
||||||
|
path: context,
|
||||||
|
env
|
||||||
|
});
|
||||||
|
|
||||||
|
// browserslist
|
||||||
|
// browserslist:env
|
||||||
|
if (config) {
|
||||||
|
try {
|
||||||
|
return browserslist(config, { env, throwOnMissing: true });
|
||||||
|
} catch (_err) {
|
||||||
|
// Nothing, no `env` was found in browserslist, maybe input is `queries`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// browserslist:query
|
||||||
|
if (env) {
|
||||||
|
return browserslist(env);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1326,8 +1326,13 @@ const applyOutputDefaults = (
|
||||||
if (tp.importScripts) return "array-push";
|
if (tp.importScripts) return "array-push";
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"For the selected environment is no default script chunk format available:\n" +
|
"For the selected environment is no default script chunk format available:\n" +
|
||||||
"JSONP Array push can be chosen when 'document' or 'importScripts' is available.\n" +
|
`${
|
||||||
`CommonJs exports can be chosen when 'require' or node builtins are available.\n${
|
tp.module
|
||||||
|
? "Module ('module') can be chosen when ES modules are available (please set 'experiments.outputModule' and 'output.module' to `true`)"
|
||||||
|
: ""
|
||||||
|
}\n` +
|
||||||
|
"JSONP Array push ('array-push') can be chosen when 'document' or 'importScripts' is available.\n" +
|
||||||
|
`CommonJs exports ('commonjs') can be chosen when 'require' or node builtins are available.\n${
|
||||||
helpMessage
|
helpMessage
|
||||||
}`
|
}`
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,7 +16,7 @@ const getBrowserslistTargetHandler = memoize(() =>
|
||||||
* @returns {string} default target
|
* @returns {string} default target
|
||||||
*/
|
*/
|
||||||
const getDefaultTarget = (context) => {
|
const getDefaultTarget = (context) => {
|
||||||
const browsers = getBrowserslistTargetHandler().load(null, context);
|
const browsers = getBrowserslistTargetHandler().load(undefined, context);
|
||||||
return browsers ? "browserslist" : "web";
|
return browsers ? "browserslist" : "web";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const InitFragment = require("../InitFragment");
|
||||||
const RuntimeGlobals = require("../RuntimeGlobals");
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||||
const RawDataUrlModule = require("../asset/RawDataUrlModule");
|
const RawDataUrlModule = require("../asset/RawDataUrlModule");
|
||||||
const {
|
const {
|
||||||
|
@ -43,6 +44,15 @@ class URLDependency extends ModuleDependency {
|
||||||
this.relative = relative || false;
|
this.relative = relative || false;
|
||||||
/** @type {UsedByExports | undefined} */
|
/** @type {UsedByExports | undefined} */
|
||||||
this.usedByExports = undefined;
|
this.usedByExports = undefined;
|
||||||
|
this.prefetch = undefined;
|
||||||
|
this.preload = undefined;
|
||||||
|
this.fetchPriority = undefined;
|
||||||
|
/** @type {string|undefined} */
|
||||||
|
this.preloadAs = undefined;
|
||||||
|
/** @type {string|undefined} */
|
||||||
|
this.preloadType = undefined;
|
||||||
|
/** @type {string|undefined} */
|
||||||
|
this.preloadMedia = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
get type() {
|
get type() {
|
||||||
|
@ -81,6 +91,12 @@ class URLDependency extends ModuleDependency {
|
||||||
write(this.outerRange);
|
write(this.outerRange);
|
||||||
write(this.relative);
|
write(this.relative);
|
||||||
write(this.usedByExports);
|
write(this.usedByExports);
|
||||||
|
write(this.prefetch);
|
||||||
|
write(this.preload);
|
||||||
|
write(this.fetchPriority);
|
||||||
|
write(this.preloadAs);
|
||||||
|
write(this.preloadType);
|
||||||
|
write(this.preloadMedia);
|
||||||
super.serialize(context);
|
super.serialize(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +108,12 @@ class URLDependency extends ModuleDependency {
|
||||||
this.outerRange = read();
|
this.outerRange = read();
|
||||||
this.relative = read();
|
this.relative = read();
|
||||||
this.usedByExports = read();
|
this.usedByExports = read();
|
||||||
|
this.prefetch = read();
|
||||||
|
this.preload = read();
|
||||||
|
this.fetchPriority = read();
|
||||||
|
this.preloadAs = read();
|
||||||
|
this.preloadType = read();
|
||||||
|
this.preloadMedia = read();
|
||||||
super.deserialize(context);
|
super.deserialize(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +121,32 @@ class URLDependency extends ModuleDependency {
|
||||||
URLDependency.Template = class URLDependencyTemplate extends (
|
URLDependency.Template = class URLDependencyTemplate extends (
|
||||||
ModuleDependency.Template
|
ModuleDependency.Template
|
||||||
) {
|
) {
|
||||||
|
/**
|
||||||
|
* Determines the 'as' attribute value for prefetch/preload based on file extension
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel/preload#what_types_of_content_can_be_preloaded
|
||||||
|
* @param {string} request module request string or filename
|
||||||
|
* @returns {string} asset type for link element 'as' attribute
|
||||||
|
*/
|
||||||
|
static _getAssetType(request) {
|
||||||
|
if (/\.(png|jpe?g|gif|svg|webp|avif|bmp|ico|tiff?)$/i.test(request)) {
|
||||||
|
return "image";
|
||||||
|
} else if (/\.(woff2?|ttf|otf|eot)$/i.test(request)) {
|
||||||
|
return "font";
|
||||||
|
} else if (/\.(js|mjs|jsx|ts|tsx)$/i.test(request)) {
|
||||||
|
return "script";
|
||||||
|
} else if (/\.css$/i.test(request)) {
|
||||||
|
return "style";
|
||||||
|
} else if (/\.vtt$/i.test(request)) {
|
||||||
|
return "track";
|
||||||
|
} else if (
|
||||||
|
/\.(mp4|webm|ogg|mp3|wav|flac|aac|m4a|avi|mov|wmv|mkv)$/i.test(request)
|
||||||
|
) {
|
||||||
|
// Audio/video files use 'fetch' as browser support varies
|
||||||
|
return "fetch";
|
||||||
|
}
|
||||||
|
return "fetch";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Dependency} dependency the dependency for which the template should be applied
|
* @param {Dependency} dependency the dependency for which the template should be applied
|
||||||
* @param {ReplaceSource} source the current replace source which can be modified
|
* @param {ReplaceSource} source the current replace source which can be modified
|
||||||
|
@ -111,9 +159,12 @@ URLDependency.Template = class URLDependencyTemplate extends (
|
||||||
moduleGraph,
|
moduleGraph,
|
||||||
runtimeRequirements,
|
runtimeRequirements,
|
||||||
runtimeTemplate,
|
runtimeTemplate,
|
||||||
runtime
|
runtime,
|
||||||
|
initFragments
|
||||||
} = templateContext;
|
} = templateContext;
|
||||||
const dep = /** @type {URLDependency} */ (dependency);
|
const dep = /** @type {URLDependency} */ (dependency);
|
||||||
|
|
||||||
|
const module = moduleGraph.getModule(dep);
|
||||||
const connection = moduleGraph.getConnection(dep);
|
const connection = moduleGraph.getConnection(dep);
|
||||||
// Skip rendering depending when dependency is conditional
|
// Skip rendering depending when dependency is conditional
|
||||||
if (connection && !connection.isTargetActive(runtime)) {
|
if (connection && !connection.isTargetActive(runtime)) {
|
||||||
|
@ -125,38 +176,87 @@ URLDependency.Template = class URLDependencyTemplate extends (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
runtimeRequirements.add(RuntimeGlobals.require);
|
// Standard URL generation
|
||||||
|
|
||||||
if (dep.relative) {
|
if (dep.relative) {
|
||||||
runtimeRequirements.add(RuntimeGlobals.relativeUrl);
|
runtimeRequirements.add(RuntimeGlobals.relativeUrl);
|
||||||
source.replace(
|
source.replace(
|
||||||
dep.outerRange[0],
|
dep.outerRange[0],
|
||||||
dep.outerRange[1] - 1,
|
dep.outerRange[1] - 1,
|
||||||
`/* asset import */ new ${
|
`/* asset import */ new ${RuntimeGlobals.relativeUrl}(${runtimeTemplate.moduleRaw(
|
||||||
RuntimeGlobals.relativeUrl
|
{
|
||||||
}(${runtimeTemplate.moduleRaw({
|
|
||||||
chunkGraph,
|
chunkGraph,
|
||||||
module: moduleGraph.getModule(dep),
|
module,
|
||||||
request: dep.request,
|
request: dep.request,
|
||||||
runtimeRequirements,
|
runtimeRequirements,
|
||||||
weak: false
|
weak: false
|
||||||
})})`
|
}
|
||||||
|
)})`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
runtimeRequirements.add(RuntimeGlobals.baseURI);
|
runtimeRequirements.add(RuntimeGlobals.baseURI);
|
||||||
|
|
||||||
source.replace(
|
source.replace(
|
||||||
dep.range[0],
|
dep.range[0],
|
||||||
dep.range[1] - 1,
|
dep.range[1] - 1,
|
||||||
`/* asset import */ ${runtimeTemplate.moduleRaw({
|
`/* asset import */ ${runtimeTemplate.moduleRaw({
|
||||||
chunkGraph,
|
chunkGraph,
|
||||||
module: moduleGraph.getModule(dep),
|
module,
|
||||||
request: dep.request,
|
request: dep.request,
|
||||||
runtimeRequirements,
|
runtimeRequirements,
|
||||||
weak: false
|
weak: false
|
||||||
})}, ${RuntimeGlobals.baseURI}`
|
})}, ${RuntimeGlobals.baseURI}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prefetch/Preload via InitFragment
|
||||||
|
if ((dep.prefetch || dep.preload) && module) {
|
||||||
|
const request = dep.request;
|
||||||
|
const detectedAssetType = URLDependencyTemplate._getAssetType(request);
|
||||||
|
const id = chunkGraph.getModuleId(module);
|
||||||
|
if (id !== null) {
|
||||||
|
const moduleId = runtimeTemplate.moduleId({
|
||||||
|
module,
|
||||||
|
chunkGraph,
|
||||||
|
request: dep.request,
|
||||||
|
weak: false
|
||||||
|
});
|
||||||
|
|
||||||
|
if (dep.preload) {
|
||||||
|
runtimeRequirements.add(RuntimeGlobals.preloadAsset);
|
||||||
|
const asArg = JSON.stringify(dep.preloadAs || detectedAssetType);
|
||||||
|
const fetchPriorityArg = dep.fetchPriority
|
||||||
|
? JSON.stringify(dep.fetchPriority)
|
||||||
|
: "undefined";
|
||||||
|
const typeArg = dep.preloadType
|
||||||
|
? JSON.stringify(dep.preloadType)
|
||||||
|
: "undefined";
|
||||||
|
const mediaArg = dep.preloadMedia
|
||||||
|
? JSON.stringify(dep.preloadMedia)
|
||||||
|
: "undefined";
|
||||||
|
initFragments.push(
|
||||||
|
new InitFragment(
|
||||||
|
`${RuntimeGlobals.preloadAsset}(${moduleId}, ${asArg}, ${fetchPriorityArg}, ${typeArg}, ${mediaArg}, ${dep.relative});\n`,
|
||||||
|
InitFragment.STAGE_CONSTANTS,
|
||||||
|
-10,
|
||||||
|
`asset_preload_${moduleId}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else if (dep.prefetch) {
|
||||||
|
runtimeRequirements.add(RuntimeGlobals.prefetchAsset);
|
||||||
|
const asArg = JSON.stringify(detectedAssetType);
|
||||||
|
const fetchPriorityArg = dep.fetchPriority
|
||||||
|
? JSON.stringify(dep.fetchPriority)
|
||||||
|
: "undefined";
|
||||||
|
initFragments.push(
|
||||||
|
new InitFragment(
|
||||||
|
`${RuntimeGlobals.prefetchAsset}(${moduleId}, ${asArg}, ${fetchPriorityArg}, undefined, undefined, ${dep.relative});\n`,
|
||||||
|
InitFragment.STAGE_CONSTANTS,
|
||||||
|
-5,
|
||||||
|
`asset_prefetch_${moduleId}`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ const WorkerDependency = require("./WorkerDependency");
|
||||||
/** @typedef {import("../../declarations/WebpackOptions").WasmLoading} WasmLoading */
|
/** @typedef {import("../../declarations/WebpackOptions").WasmLoading} WasmLoading */
|
||||||
/** @typedef {import("../../declarations/WebpackOptions").WorkerPublicPath} WorkerPublicPath */
|
/** @typedef {import("../../declarations/WebpackOptions").WorkerPublicPath} WorkerPublicPath */
|
||||||
/** @typedef {import("../Compiler")} Compiler */
|
/** @typedef {import("../Compiler")} Compiler */
|
||||||
|
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
|
||||||
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
/** @typedef {import("../Dependency").DependencyLocation} DependencyLocation */
|
||||||
/** @typedef {import("../Entrypoint").EntryOptions} EntryOptions */
|
/** @typedef {import("../Entrypoint").EntryOptions} EntryOptions */
|
||||||
/** @typedef {import("../NormalModule")} NormalModule */
|
/** @typedef {import("../NormalModule")} NormalModule */
|
||||||
|
@ -223,9 +224,12 @@ class WorkerPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const insertType = expr.properties.length > 0 ? "comma" : "single";
|
const insertType = expr.properties.length > 0 ? "comma" : "single";
|
||||||
const insertLocation = /** @type {Range} */ (
|
const insertLocation =
|
||||||
|
expr.properties.length > 0
|
||||||
|
? /** @type {Range} */ (
|
||||||
expr.properties[expr.properties.length - 1].range
|
expr.properties[expr.properties.length - 1].range
|
||||||
)[1];
|
)[1]
|
||||||
|
: /** @type {Range} */ (expr.range)[0] + 1;
|
||||||
return {
|
return {
|
||||||
expressions,
|
expressions,
|
||||||
otherElements,
|
otherElements,
|
||||||
|
@ -299,6 +303,10 @@ class WorkerPlugin {
|
||||||
? /** @type {Range} */ (arg2.range)
|
? /** @type {Range} */ (arg2.range)
|
||||||
: /** @type {Range} */ (arg1.range)[1]
|
: /** @type {Range} */ (arg1.range)[1]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** @type {RawChunkGroupOptions} */
|
||||||
|
const groupOptions = {};
|
||||||
|
|
||||||
const { options: importOptions, errors: commentErrors } =
|
const { options: importOptions, errors: commentErrors } =
|
||||||
parser.parseCommentOptions(/** @type {Range} */ (expr.range));
|
parser.parseCommentOptions(/** @type {Range} */ (expr.range));
|
||||||
|
|
||||||
|
@ -360,6 +368,60 @@ class WorkerPlugin {
|
||||||
entryOptions.name = importOptions.webpackChunkName;
|
entryOptions.name = importOptions.webpackChunkName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support webpackPrefetch (true | number)
|
||||||
|
if (importOptions.webpackPrefetch !== undefined) {
|
||||||
|
if (importOptions.webpackPrefetch === true) {
|
||||||
|
groupOptions.prefetchOrder = 0;
|
||||||
|
} else if (typeof importOptions.webpackPrefetch === "number") {
|
||||||
|
groupOptions.prefetchOrder = importOptions.webpackPrefetch;
|
||||||
|
} else {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackPrefetch\` expected true or a number, but received: ${importOptions.webpackPrefetch}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Support webpackPreload (true | number)
|
||||||
|
if (importOptions.webpackPreload !== undefined) {
|
||||||
|
if (importOptions.webpackPreload === true) {
|
||||||
|
groupOptions.preloadOrder = 0;
|
||||||
|
} else if (typeof importOptions.webpackPreload === "number") {
|
||||||
|
groupOptions.preloadOrder = importOptions.webpackPreload;
|
||||||
|
} else {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackPreload\` expected true or a number, but received: ${importOptions.webpackPreload}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Support webpackFetchPriority ("high" | "low" | "auto")
|
||||||
|
if (importOptions.webpackFetchPriority !== undefined) {
|
||||||
|
if (
|
||||||
|
typeof importOptions.webpackFetchPriority === "string" &&
|
||||||
|
["high", "low", "auto"].includes(
|
||||||
|
importOptions.webpackFetchPriority
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
groupOptions.fetchPriority =
|
||||||
|
/** @type {"auto" | "high" | "low"} */ (
|
||||||
|
importOptions.webpackFetchPriority
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackFetchPriority\` expected "low", "high" or "auto", but received: ${importOptions.webpackFetchPriority}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -388,6 +450,7 @@ class WorkerPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
const block = new AsyncDependenciesBlock({
|
const block = new AsyncDependenciesBlock({
|
||||||
|
...groupOptions,
|
||||||
name: entryOptions.name,
|
name: entryOptions.name,
|
||||||
entryOptions: {
|
entryOptions: {
|
||||||
chunkLoading: this._chunkLoading,
|
chunkLoading: this._chunkLoading,
|
||||||
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
/*
|
||||||
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||||
|
Author Tobias Koppers @sokra
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const RuntimeGlobals = require("../RuntimeGlobals");
|
||||||
|
const RuntimeModule = require("../RuntimeModule");
|
||||||
|
const Template = require("../Template");
|
||||||
|
|
||||||
|
/** @typedef {import("../Compilation")} Compilation */
|
||||||
|
|
||||||
|
class ResourcePrefetchRuntimeModule extends RuntimeModule {
|
||||||
|
/**
|
||||||
|
* @param {string} type "prefetch" or "preload"
|
||||||
|
*/
|
||||||
|
constructor(type) {
|
||||||
|
super(`asset ${type}`, RuntimeModule.STAGE_ATTACH);
|
||||||
|
this._type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {string | null} runtime code
|
||||||
|
*/
|
||||||
|
generate() {
|
||||||
|
const { compilation } = this;
|
||||||
|
if (!compilation) return null;
|
||||||
|
|
||||||
|
const { runtimeTemplate, outputOptions } = compilation;
|
||||||
|
const fnName =
|
||||||
|
this._type === "prefetch"
|
||||||
|
? RuntimeGlobals.prefetchAsset
|
||||||
|
: RuntimeGlobals.preloadAsset;
|
||||||
|
|
||||||
|
const crossOriginLoading = outputOptions.crossOriginLoading;
|
||||||
|
const isNeutralPlatform = runtimeTemplate.isNeutralPlatform();
|
||||||
|
|
||||||
|
// For neutral platform (universal targets), generate code that checks for document at runtime
|
||||||
|
const code = [
|
||||||
|
"var url;",
|
||||||
|
"if (relative) {",
|
||||||
|
Template.indent([
|
||||||
|
`url = new ${RuntimeGlobals.relativeUrl}(${RuntimeGlobals.require}(moduleId));`
|
||||||
|
]),
|
||||||
|
"} else {",
|
||||||
|
Template.indent([
|
||||||
|
`url = new URL(${RuntimeGlobals.require}(moduleId), ${RuntimeGlobals.baseURI});`
|
||||||
|
]),
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"var link = document.createElement('link');",
|
||||||
|
`link.rel = '${this._type}';`,
|
||||||
|
"if (as) link.as = as;",
|
||||||
|
"link.href = url.href;",
|
||||||
|
"",
|
||||||
|
"if (fetchPriority) {",
|
||||||
|
Template.indent([
|
||||||
|
"link.fetchPriority = fetchPriority;",
|
||||||
|
"link.setAttribute('fetchpriority', fetchPriority);"
|
||||||
|
]),
|
||||||
|
"}",
|
||||||
|
"",
|
||||||
|
"if (type) link.type = type;",
|
||||||
|
"if (media) link.media = media;",
|
||||||
|
"",
|
||||||
|
crossOriginLoading
|
||||||
|
? Template.asString([
|
||||||
|
"if (link.href.indexOf(window.location.origin + '/') !== 0) {",
|
||||||
|
Template.indent([
|
||||||
|
`link.crossOrigin = ${JSON.stringify(crossOriginLoading)};`
|
||||||
|
]),
|
||||||
|
"}"
|
||||||
|
])
|
||||||
|
: "",
|
||||||
|
"",
|
||||||
|
"document.head.appendChild(link);"
|
||||||
|
];
|
||||||
|
|
||||||
|
// For neutral platform, wrap the code to check for document availability
|
||||||
|
if (isNeutralPlatform) {
|
||||||
|
return Template.asString([
|
||||||
|
`${fnName} = ${runtimeTemplate.basicFunction(
|
||||||
|
"moduleId, as, fetchPriority, type, media, relative",
|
||||||
|
[
|
||||||
|
"// Only execute in browser environment",
|
||||||
|
"if (typeof document !== 'undefined') {",
|
||||||
|
Template.indent(code),
|
||||||
|
"}"
|
||||||
|
]
|
||||||
|
)};`
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// For browser-only targets, generate code without the check
|
||||||
|
return Template.asString([
|
||||||
|
`${fnName} = ${runtimeTemplate.basicFunction(
|
||||||
|
"moduleId, as, fetchPriority, type, media, relative",
|
||||||
|
code
|
||||||
|
)};`
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = ResourcePrefetchRuntimeModule;
|
|
@ -182,6 +182,91 @@ class URLParserPlugin {
|
||||||
relative
|
relative
|
||||||
);
|
);
|
||||||
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
|
||||||
|
// Parse magic comments with simplified rules
|
||||||
|
if (importOptions) {
|
||||||
|
// Accept only boolean true for webpackPrefetch
|
||||||
|
if (importOptions.webpackPrefetch === true) {
|
||||||
|
dep.prefetch = true;
|
||||||
|
} else if (importOptions.webpackPrefetch !== undefined) {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackPrefetch\` expected true, but received: ${importOptions.webpackPrefetch}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Accept only boolean true for webpackPreload
|
||||||
|
if (importOptions.webpackPreload === true) {
|
||||||
|
dep.preload = true;
|
||||||
|
} else if (importOptions.webpackPreload !== undefined) {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackPreload\` expected true, but received: ${importOptions.webpackPreload}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// webpackFetchPriority: "high" | "low" | "auto"
|
||||||
|
if (
|
||||||
|
typeof importOptions.webpackFetchPriority === "string" &&
|
||||||
|
["high", "low", "auto"].includes(importOptions.webpackFetchPriority)
|
||||||
|
) {
|
||||||
|
dep.fetchPriority = importOptions.webpackFetchPriority;
|
||||||
|
} else if (importOptions.webpackFetchPriority !== undefined) {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackFetchPriority\` expected "low", "high" or "auto", but received: ${importOptions.webpackFetchPriority}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// webpackPreloadAs: allow override of the "as" attribute for preload
|
||||||
|
if (importOptions.webpackPreloadAs !== undefined) {
|
||||||
|
if (typeof importOptions.webpackPreloadAs === "string") {
|
||||||
|
dep.preloadAs = importOptions.webpackPreloadAs;
|
||||||
|
} else {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackPreloadAs\` expected a string, but received: ${importOptions.webpackPreloadAs}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// webpackPreloadType: set link.type when provided
|
||||||
|
if (importOptions.webpackPreloadType !== undefined) {
|
||||||
|
if (typeof importOptions.webpackPreloadType === "string") {
|
||||||
|
dep.preloadType = importOptions.webpackPreloadType;
|
||||||
|
} else {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackPreloadType\` expected a string, but received: ${importOptions.webpackPreloadType}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// webpackPreloadMedia: set link.media when provided
|
||||||
|
if (importOptions.webpackPreloadMedia !== undefined) {
|
||||||
|
if (typeof importOptions.webpackPreloadMedia === "string") {
|
||||||
|
dep.preloadMedia = importOptions.webpackPreloadMedia;
|
||||||
|
} else {
|
||||||
|
parser.state.module.addWarning(
|
||||||
|
new UnsupportedFeatureWarning(
|
||||||
|
`\`webpackPreloadMedia\` expected a string, but received: ${importOptions.webpackPreloadMedia}.`,
|
||||||
|
/** @type {DependencyLocation} */ (expr.loc)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Register the dependency
|
||||||
parser.state.current.addDependency(dep);
|
parser.state.current.addDependency(dep);
|
||||||
InnerGraph.onUsage(parser.state, (e) => (dep.usedByExports = e));
|
InnerGraph.onUsage(parser.state, (e) => (dep.usedByExports = e));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
"@webassemblyjs/wasm-parser": "^1.14.1",
|
"@webassemblyjs/wasm-parser": "^1.14.1",
|
||||||
"acorn": "^8.15.0",
|
"acorn": "^8.15.0",
|
||||||
"acorn-import-phases": "^1.0.3",
|
"acorn-import-phases": "^1.0.3",
|
||||||
"browserslist": "^4.24.5",
|
"browserslist": "^4.26.3",
|
||||||
"chrome-trace-event": "^1.0.2",
|
"chrome-trace-event": "^1.0.2",
|
||||||
"enhanced-resolve": "^5.17.3",
|
"enhanced-resolve": "^5.17.3",
|
||||||
"es-module-lexer": "^1.2.1",
|
"es-module-lexer": "^1.2.1",
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
body {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
.typed-element {
|
||||||
|
color: #333;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
// This file is used to generate expected warnings during compilation
|
||||||
|
|
||||||
|
// Invalid fetchPriority value - should generate warning
|
||||||
|
const invalidPriorityUrl = new URL(/* webpackPrefetch: true */ /* webpackFetchPriority: "invalid" */ "./assets/images/priority-invalid.png", import.meta.url);
|
||||||
|
// Invalid preloadAs (non-string) - should generate warning
|
||||||
|
const invalidPreloadAs = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
/* webpackPreloadAs: 123 */
|
||||||
|
"./assets/images/priority-invalid.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
// Invalid preloadType (non-string) - should generate warning
|
||||||
|
const invalidPreloadType = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
/* webpackPreloadType: 123 */
|
||||||
|
"./assets/images/priority-invalid.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
|
||||||
|
// Invalid preloadMedia (non-string) - should generate warning
|
||||||
|
const invalidPreloadMedia = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
/* webpackPreloadMedia: 456 */
|
||||||
|
"./assets/images/priority-invalid.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
|
||||||
|
export default {};
|
|
@ -0,0 +1,178 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function verifyLink(link, expectations) {
|
||||||
|
expect(link._type).toBe("link");
|
||||||
|
expect(link.rel).toBe(expectations.rel);
|
||||||
|
|
||||||
|
if (expectations.as) {
|
||||||
|
expect(link.as).toBe(expectations.as);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expectations.type !== undefined) {
|
||||||
|
if (expectations.type) {
|
||||||
|
expect(link.type).toBe(expectations.type);
|
||||||
|
} else {
|
||||||
|
expect(link.type).toBeUndefined();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expectations.media !== undefined) {
|
||||||
|
if (expectations.media) {
|
||||||
|
expect(link.media).toBe(expectations.media);
|
||||||
|
} else {
|
||||||
|
expect(link.media).toBeUndefined();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expectations.fetchPriority !== undefined) {
|
||||||
|
if (expectations.fetchPriority) {
|
||||||
|
expect(link._attributes.fetchpriority).toBe(expectations.fetchPriority);
|
||||||
|
expect(link.fetchPriority).toBe(expectations.fetchPriority);
|
||||||
|
} else {
|
||||||
|
expect(link._attributes.fetchpriority).toBeUndefined();
|
||||||
|
expect(link.fetchPriority).toBeUndefined();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (expectations.href) {
|
||||||
|
expect(link.href.toString()).toMatch(expectations.href);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
it("should generate all prefetch and preload links", () => {
|
||||||
|
const urls = {
|
||||||
|
prefetchHigh: new URL(
|
||||||
|
/* webpackPrefetch: true */ /* webpackFetchPriority: "high" */
|
||||||
|
"./assets/images/priority-high.png",
|
||||||
|
import.meta.url
|
||||||
|
),
|
||||||
|
preloadLow: new URL(
|
||||||
|
/* webpackPreload: true */ /* webpackFetchPriority: "low" */
|
||||||
|
"./assets/styles/priority-low.css",
|
||||||
|
import.meta.url
|
||||||
|
),
|
||||||
|
prefetchAuto: new URL(
|
||||||
|
/* webpackPrefetch: true */ /* webpackFetchPriority: "auto" */
|
||||||
|
"./priority-auto.js",
|
||||||
|
import.meta.url
|
||||||
|
),
|
||||||
|
bothHints: new URL(
|
||||||
|
/* webpackPrefetch: true */ /* webpackPreload: true */ /* webpackFetchPriority: "high" */
|
||||||
|
"./assets/images/both-hints.png",
|
||||||
|
import.meta.url
|
||||||
|
),
|
||||||
|
noPriority: new URL(
|
||||||
|
/* webpackPrefetch: true */
|
||||||
|
"./assets/images/test.png",
|
||||||
|
import.meta.url
|
||||||
|
),
|
||||||
|
preloadFont: new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
"./assets/fonts/test.woff2",
|
||||||
|
import.meta.url
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const prefetchHighLink = document.head._children.find(
|
||||||
|
link => link.href.includes("priority-high.png") && link.rel === "prefetch"
|
||||||
|
);
|
||||||
|
expect(prefetchHighLink).toBeTruthy();
|
||||||
|
verifyLink(prefetchHighLink, {
|
||||||
|
rel: "prefetch",
|
||||||
|
as: "image",
|
||||||
|
fetchPriority: "high",
|
||||||
|
href: /priority-high\.png$/
|
||||||
|
});
|
||||||
|
|
||||||
|
const preloadLowLink = document.head._children.find(
|
||||||
|
link => link.href.includes("priority-low.css") && link.rel === "preload"
|
||||||
|
);
|
||||||
|
expect(preloadLowLink).toBeTruthy();
|
||||||
|
verifyLink(preloadLowLink, {
|
||||||
|
rel: "preload",
|
||||||
|
as: "style",
|
||||||
|
fetchPriority: "low",
|
||||||
|
href: /priority-low\.css$/
|
||||||
|
});
|
||||||
|
|
||||||
|
const prefetchAutoLink = document.head._children.find(
|
||||||
|
link => link.href.includes("priority-auto.js") && link.rel === "prefetch"
|
||||||
|
);
|
||||||
|
expect(prefetchAutoLink).toBeTruthy();
|
||||||
|
verifyLink(prefetchAutoLink, {
|
||||||
|
rel: "prefetch",
|
||||||
|
as: "script",
|
||||||
|
fetchPriority: "auto"
|
||||||
|
});
|
||||||
|
|
||||||
|
const bothHintsLink = document.head._children.find(
|
||||||
|
link => link.href.includes("both-hints.png")
|
||||||
|
);
|
||||||
|
expect(bothHintsLink).toBeTruthy();
|
||||||
|
expect(bothHintsLink.rel).toBe("preload");
|
||||||
|
expect(bothHintsLink._attributes.fetchpriority).toBe("high");
|
||||||
|
|
||||||
|
const noPriorityLink = document.head._children.find(
|
||||||
|
link => link.href.includes("test.png") && link.rel === "prefetch" &&
|
||||||
|
!link._attributes.fetchpriority
|
||||||
|
);
|
||||||
|
expect(noPriorityLink).toBeTruthy();
|
||||||
|
verifyLink(noPriorityLink, {
|
||||||
|
rel: "prefetch",
|
||||||
|
as: "image",
|
||||||
|
fetchPriority: undefined
|
||||||
|
});
|
||||||
|
|
||||||
|
const fontPreloadLink = document.head._children.find(
|
||||||
|
link => link.href.includes("test.woff2") && link.rel === "preload"
|
||||||
|
);
|
||||||
|
expect(fontPreloadLink).toBeTruthy();
|
||||||
|
verifyLink(fontPreloadLink, {
|
||||||
|
rel: "preload",
|
||||||
|
as: "font",
|
||||||
|
href: /test\.woff2$/
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should allow overriding as/type/media via magic comments", () => {
|
||||||
|
const override = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
/* webpackPreloadAs: "font" */
|
||||||
|
/* webpackPreloadType: "font/woff2" */
|
||||||
|
/* webpackPreloadMedia: "(max-width: 600px)" */
|
||||||
|
"./assets/images/override.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
|
||||||
|
const link = document.head._children.find(
|
||||||
|
l => l.href.includes("override.png") && l.rel === "preload"
|
||||||
|
);
|
||||||
|
expect(link).toBeTruthy();
|
||||||
|
verifyLink(link, {
|
||||||
|
rel: "preload",
|
||||||
|
as: "font",
|
||||||
|
type: "font/woff2",
|
||||||
|
media: "(max-width: 600px)",
|
||||||
|
href: /override\.png$/
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should accept additional as tokens from Fetch Standard (e.g., sharedworker)", () => {
|
||||||
|
const u = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
/* webpackPreloadAs: "sharedworker" */
|
||||||
|
"./priority-auto.js",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
|
||||||
|
const link = document.head._children.find(
|
||||||
|
l => l.href.includes("priority-auto.js") && l.rel === "preload"
|
||||||
|
);
|
||||||
|
expect(link).toBeTruthy();
|
||||||
|
verifyLink(link, {
|
||||||
|
rel: "preload",
|
||||||
|
as: "sharedworker",
|
||||||
|
href: /priority-auto\.js$/
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,4 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
// Test asset file
|
||||||
|
console.log("priority-auto.js loaded");
|
|
@ -0,0 +1,66 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
// Mock document.head structure for testing
|
||||||
|
const mockCreateElement = (tagName) => {
|
||||||
|
const element = {
|
||||||
|
_type: tagName,
|
||||||
|
_attributes: {},
|
||||||
|
setAttribute(name, value) {
|
||||||
|
this._attributes[name] = value;
|
||||||
|
// Also set as property for fetchPriority
|
||||||
|
if (name === "fetchpriority") {
|
||||||
|
this.fetchPriority = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getAttribute(name) {
|
||||||
|
return this._attributes[name];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Set properties based on tag type
|
||||||
|
if (tagName === "link") {
|
||||||
|
element.rel = "";
|
||||||
|
element.as = "";
|
||||||
|
element.href = "";
|
||||||
|
element.type = undefined;
|
||||||
|
element.media = undefined;
|
||||||
|
element.fetchPriority = undefined;
|
||||||
|
} else if (tagName === "script") {
|
||||||
|
element.src = "";
|
||||||
|
element.async = true;
|
||||||
|
element.fetchPriority = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return element;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
beforeExecute: () => {
|
||||||
|
// Mock document for browser environment
|
||||||
|
global.document = {
|
||||||
|
head: {
|
||||||
|
_children: [],
|
||||||
|
appendChild(element) {
|
||||||
|
this._children.push(element);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
createElement: mockCreateElement
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock window for import.meta.url
|
||||||
|
global.window = {
|
||||||
|
location: {
|
||||||
|
href: "https://test.example.com/"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
findBundle() {
|
||||||
|
return ["main.js"];
|
||||||
|
},
|
||||||
|
|
||||||
|
moduleScope(scope) {
|
||||||
|
// Make document available in the module scope
|
||||||
|
scope.document = global.document;
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,4 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
// Test JavaScript file
|
||||||
|
console.log("test.js loaded");
|
|
@ -0,0 +1,14 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = [
|
||||||
|
// Invalid fetchPriority value warning
|
||||||
|
[
|
||||||
|
/`webpackFetchPriority` expected "low", "high" or "auto", but received: invalid\./
|
||||||
|
],
|
||||||
|
// Invalid preloadAs (non-string)
|
||||||
|
[/`webpackPreloadAs` expected a string, but received: 123\./],
|
||||||
|
// Invalid preloadType (non-string)
|
||||||
|
[/`webpackPreloadType` expected a string, but received: 123\./],
|
||||||
|
// Invalid preloadMedia (non-string)
|
||||||
|
[/`webpackPreloadMedia` expected a string, but received: 456\./]
|
||||||
|
];
|
|
@ -0,0 +1,24 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/** @type {import("../../../../types").Configuration} */
|
||||||
|
module.exports = {
|
||||||
|
mode: "development",
|
||||||
|
entry: {
|
||||||
|
main: "./index.js",
|
||||||
|
warnings: "./generate-warnings.js"
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: "[name].js",
|
||||||
|
assetModuleFilename: "[name][ext]",
|
||||||
|
publicPath: "/public/"
|
||||||
|
},
|
||||||
|
target: "web",
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(png|jpg|css|woff2)$/,
|
||||||
|
type: "asset/resource"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
extends browserslist-config-mycompany
|
|
@ -0,0 +1 @@
|
||||||
|
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,37 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const rootPath = path.resolve(__dirname, "../../../../");
|
||||||
|
const rootNodeModules = path.resolve(rootPath, "./node_modules");
|
||||||
|
const browserslistPackage = path.resolve(
|
||||||
|
rootNodeModules,
|
||||||
|
"browserslist-config-mycompany"
|
||||||
|
);
|
||||||
|
const content = `
|
||||||
|
module.exports = {
|
||||||
|
development: [
|
||||||
|
'last 1 version'
|
||||||
|
],
|
||||||
|
production: [
|
||||||
|
'ie 9',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
const browserslistFile = path.resolve(browserslistPackage, "./index.js");
|
||||||
|
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(browserslistPackage);
|
||||||
|
} catch (_err) {
|
||||||
|
// Nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(browserslistFile, content);
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
afterExecute() {
|
||||||
|
fs.unlinkSync(browserslistFile);
|
||||||
|
fs.rmdirSync(browserslistPackage);
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,43 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
/** @type {import("../../../../").Configuration} */
|
||||||
|
module.exports = {
|
||||||
|
target: `browserslist:${path.join(__dirname, ".browserslistrc")}:production`,
|
||||||
|
plugins: [
|
||||||
|
(compiler) => {
|
||||||
|
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||||
|
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"arrowFunction": false,
|
||||||
|
"asyncFunction": false,
|
||||||
|
"bigIntLiteral": false,
|
||||||
|
"const": false,
|
||||||
|
"destructuring": false,
|
||||||
|
"document": true,
|
||||||
|
"dynamicImport": false,
|
||||||
|
"dynamicImportInWorker": false,
|
||||||
|
"forOf": false,
|
||||||
|
"globalThis": false,
|
||||||
|
"module": false,
|
||||||
|
"nodePrefixForCoreModules": false,
|
||||||
|
"optionalChaining": false,
|
||||||
|
"templateLiteral": false,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"electron": false,
|
||||||
|
"electronMain": false,
|
||||||
|
"electronPreload": false,
|
||||||
|
"electronRenderer": false,
|
||||||
|
"node": false,
|
||||||
|
"nwjs": false,
|
||||||
|
"web": true,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
extends browserslist-config-mycompany1
|
|
@ -0,0 +1 @@
|
||||||
|
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,38 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const rootPath = path.resolve(__dirname, "../../../../");
|
||||||
|
const rootNodeModules = path.resolve(rootPath, "./node_modules");
|
||||||
|
const browserslistPackage = path.resolve(
|
||||||
|
rootNodeModules,
|
||||||
|
"browserslist-config-mycompany1"
|
||||||
|
);
|
||||||
|
const content = `
|
||||||
|
module.exports = {
|
||||||
|
development: [
|
||||||
|
'last 1 version'
|
||||||
|
],
|
||||||
|
// We are in tests, so 'process.env.NODE_ENV' has the 'test' value (browserslist respects the 'process.env.NODE_ENV' value)
|
||||||
|
test: [
|
||||||
|
'ie 9',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
const browserslistFile = path.resolve(browserslistPackage, "./index.js");
|
||||||
|
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(browserslistPackage);
|
||||||
|
} catch (_err) {
|
||||||
|
// Nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(browserslistFile, content);
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
afterExecute() {
|
||||||
|
fs.unlinkSync(browserslistFile);
|
||||||
|
fs.rmdirSync(browserslistPackage);
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,43 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
/** @type {import("../../../../").Configuration} */
|
||||||
|
module.exports = {
|
||||||
|
target: `browserslist:${path.join(__dirname, ".browserslistrc")}`,
|
||||||
|
plugins: [
|
||||||
|
(compiler) => {
|
||||||
|
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||||
|
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"arrowFunction": false,
|
||||||
|
"asyncFunction": false,
|
||||||
|
"bigIntLiteral": false,
|
||||||
|
"const": false,
|
||||||
|
"destructuring": false,
|
||||||
|
"document": true,
|
||||||
|
"dynamicImport": false,
|
||||||
|
"dynamicImportInWorker": false,
|
||||||
|
"forOf": false,
|
||||||
|
"globalThis": false,
|
||||||
|
"module": false,
|
||||||
|
"nodePrefixForCoreModules": false,
|
||||||
|
"optionalChaining": false,
|
||||||
|
"templateLiteral": false,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"electron": false,
|
||||||
|
"electronMain": false,
|
||||||
|
"electronPreload": false,
|
||||||
|
"electronRenderer": false,
|
||||||
|
"node": false,
|
||||||
|
"nwjs": false,
|
||||||
|
"web": true,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"browserslist": {
|
||||||
|
"development": [
|
||||||
|
"last 1 version"
|
||||||
|
],
|
||||||
|
"production": [
|
||||||
|
"ie 9"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/** @type {import("../../../../").Configuration} */
|
||||||
|
module.exports = {
|
||||||
|
target: "browserslist:production",
|
||||||
|
plugins: [
|
||||||
|
(compiler) => {
|
||||||
|
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||||
|
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"arrowFunction": false,
|
||||||
|
"asyncFunction": false,
|
||||||
|
"bigIntLiteral": false,
|
||||||
|
"const": false,
|
||||||
|
"destructuring": false,
|
||||||
|
"document": true,
|
||||||
|
"dynamicImport": false,
|
||||||
|
"dynamicImportInWorker": false,
|
||||||
|
"forOf": false,
|
||||||
|
"globalThis": false,
|
||||||
|
"module": false,
|
||||||
|
"nodePrefixForCoreModules": false,
|
||||||
|
"optionalChaining": false,
|
||||||
|
"templateLiteral": false,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"electron": false,
|
||||||
|
"electronMain": false,
|
||||||
|
"electronPreload": false,
|
||||||
|
"electronRenderer": false,
|
||||||
|
"node": false,
|
||||||
|
"nwjs": false,
|
||||||
|
"web": true,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"browserslist": [
|
||||||
|
"extends browserslist-config-mycompany2"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const rootPath = path.resolve(__dirname, "../../../../");
|
||||||
|
const rootNodeModules = path.resolve(rootPath, "./node_modules");
|
||||||
|
const browserslistPackage = path.resolve(
|
||||||
|
rootNodeModules,
|
||||||
|
"browserslist-config-mycompany2"
|
||||||
|
);
|
||||||
|
const content = `
|
||||||
|
module.exports = {
|
||||||
|
development: [
|
||||||
|
'last 1 version'
|
||||||
|
],
|
||||||
|
// We are in tests, so 'process.env.NODE_ENV' has the 'test' value (browserslist respects the 'process.env.NODE_ENV' value)
|
||||||
|
test: [
|
||||||
|
'ie 9',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
const browserslistFile = path.resolve(browserslistPackage, "./index.js");
|
||||||
|
|
||||||
|
try {
|
||||||
|
fs.mkdirSync(browserslistPackage);
|
||||||
|
} catch (_err) {
|
||||||
|
// Nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(browserslistFile, content);
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
afterExecute() {
|
||||||
|
fs.unlinkSync(browserslistFile);
|
||||||
|
fs.rmdirSync(browserslistPackage);
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,41 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/** @type {import("../../../../").Configuration} */
|
||||||
|
module.exports = {
|
||||||
|
target: "browserslist",
|
||||||
|
plugins: [
|
||||||
|
(compiler) => {
|
||||||
|
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||||
|
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"arrowFunction": false,
|
||||||
|
"asyncFunction": false,
|
||||||
|
"bigIntLiteral": false,
|
||||||
|
"const": false,
|
||||||
|
"destructuring": false,
|
||||||
|
"document": true,
|
||||||
|
"dynamicImport": false,
|
||||||
|
"dynamicImportInWorker": false,
|
||||||
|
"forOf": false,
|
||||||
|
"globalThis": false,
|
||||||
|
"module": false,
|
||||||
|
"nodePrefixForCoreModules": false,
|
||||||
|
"optionalChaining": false,
|
||||||
|
"templateLiteral": false,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"electron": false,
|
||||||
|
"electronMain": false,
|
||||||
|
"electronPreload": false,
|
||||||
|
"electronRenderer": false,
|
||||||
|
"node": false,
|
||||||
|
"nwjs": false,
|
||||||
|
"web": true,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
it("should compile and run the test", function() {});
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"browserslist": {
|
||||||
|
"development": [
|
||||||
|
"last 1 version"
|
||||||
|
],
|
||||||
|
"production": [
|
||||||
|
"ie 9"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/** @type {import("../../../../").Configuration} */
|
||||||
|
module.exports = {
|
||||||
|
target: "browserslist:maintained node versions",
|
||||||
|
plugins: [
|
||||||
|
(compiler) => {
|
||||||
|
compiler.hooks.compilation.tap("Test", (compilation) => {
|
||||||
|
expect(compilation.outputOptions.environment).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"arrowFunction": true,
|
||||||
|
"asyncFunction": true,
|
||||||
|
"bigIntLiteral": true,
|
||||||
|
"const": true,
|
||||||
|
"destructuring": true,
|
||||||
|
"document": false,
|
||||||
|
"dynamicImport": true,
|
||||||
|
"dynamicImportInWorker": false,
|
||||||
|
"forOf": true,
|
||||||
|
"globalThis": true,
|
||||||
|
"module": true,
|
||||||
|
"nodePrefixForCoreModules": true,
|
||||||
|
"optionalChaining": true,
|
||||||
|
"templateLiteral": true,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
expect(compilation.options.externalsPresets).toMatchInlineSnapshot(`
|
||||||
|
Object {
|
||||||
|
"electron": false,
|
||||||
|
"electronMain": false,
|
||||||
|
"electronPreload": false,
|
||||||
|
"electronRenderer": false,
|
||||||
|
"node": true,
|
||||||
|
"nwjs": false,
|
||||||
|
"web": false,
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
Binary file not shown.
After Width: | Height: | Size: 68 B |
|
@ -0,0 +1,49 @@
|
||||||
|
// Test cases for new URL() prefetch/preload support
|
||||||
|
|
||||||
|
it("should prefetch an image asset", () => {
|
||||||
|
const url = new URL(
|
||||||
|
/* webpackPrefetch: true */
|
||||||
|
"./prefetch-image.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
expect(url.href).toMatch(/prefetch-image\.png$/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should preload an image asset", () => {
|
||||||
|
const url = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
"./preload-image.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
expect(url.href).toMatch(/preload-image\.png$/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should preload with fetch priority", () => {
|
||||||
|
const url = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
/* webpackFetchPriority: "high" */
|
||||||
|
"./priority-image.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
expect(url.href).toMatch(/priority-image\.png$/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle invalid fetch priority", () => {
|
||||||
|
const url2 = new URL(
|
||||||
|
/* webpackPreload: true */
|
||||||
|
/* webpackFetchPriority: "invalid" */
|
||||||
|
"./invalid-priority-image.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
expect(url2.href).toMatch(/invalid-priority-image\.png$/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should handle both prefetch and preload", () => {
|
||||||
|
const url3 = new URL(
|
||||||
|
/* webpackPrefetch: true */
|
||||||
|
/* webpackPreload: true */
|
||||||
|
"./both-hints-image.png",
|
||||||
|
import.meta.url
|
||||||
|
);
|
||||||
|
expect(url3.href).toMatch(/both-hints-image\.png$/);
|
||||||
|
});
|
Binary file not shown.
After Width: | Height: | Size: 68 B |
Binary file not shown.
After Width: | Height: | Size: 68 B |
Binary file not shown.
After Width: | Height: | Size: 68 B |
Binary file not shown.
After Width: | Height: | Size: 68 B |
|
@ -0,0 +1,7 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
findBundle() {
|
||||||
|
return ["main.js"];
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,5 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const supportsWorker = require("../../../helpers/supportsWorker");
|
||||||
|
|
||||||
|
module.exports = () => supportsWorker();
|
|
@ -0,0 +1,8 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports = [
|
||||||
|
// Invalid fetch priority
|
||||||
|
[
|
||||||
|
/`webpackFetchPriority` expected "low", "high" or "auto", but received: invalid\./
|
||||||
|
]
|
||||||
|
];
|
|
@ -0,0 +1,18 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
/** @type {import("../../../../types").Configuration} */
|
||||||
|
module.exports = {
|
||||||
|
output: {
|
||||||
|
filename: "[name].js",
|
||||||
|
assetModuleFilename: "[name][ext]"
|
||||||
|
},
|
||||||
|
target: "web",
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.png$/,
|
||||||
|
type: "asset/resource"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
|
@ -18448,8 +18448,10 @@ declare namespace exports {
|
||||||
export let moduleLoaded: "module.loaded";
|
export let moduleLoaded: "module.loaded";
|
||||||
export let nodeModuleDecorator: "__webpack_require__.nmd";
|
export let nodeModuleDecorator: "__webpack_require__.nmd";
|
||||||
export let onChunksLoaded: "__webpack_require__.O";
|
export let onChunksLoaded: "__webpack_require__.O";
|
||||||
|
export let prefetchAsset: "__webpack_require__.PA";
|
||||||
export let prefetchChunk: "__webpack_require__.E";
|
export let prefetchChunk: "__webpack_require__.E";
|
||||||
export let prefetchChunkHandlers: "__webpack_require__.F";
|
export let prefetchChunkHandlers: "__webpack_require__.F";
|
||||||
|
export let preloadAsset: "__webpack_require__.LA";
|
||||||
export let preloadChunk: "__webpack_require__.G";
|
export let preloadChunk: "__webpack_require__.G";
|
||||||
export let preloadChunkHandlers: "__webpack_require__.H";
|
export let preloadChunkHandlers: "__webpack_require__.H";
|
||||||
export let publicPath: "__webpack_require__.p";
|
export let publicPath: "__webpack_require__.p";
|
||||||
|
|
134
yarn.lock
134
yarn.lock
|
@ -995,13 +995,6 @@
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
jest-mock "30.2.0"
|
jest-mock "30.2.0"
|
||||||
|
|
||||||
"@jest/expect-utils@30.1.2":
|
|
||||||
version "30.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-30.1.2.tgz#88ea18040f707c9fadb6fd9e77568cae5266cee8"
|
|
||||||
integrity sha512-HXy1qT/bfdjCv7iC336ExbqqYtZvljrV8odNdso7dWK9bSeHtLlvwWWC3YSybSPL03Gg5rug6WLCZAZFH72m0A==
|
|
||||||
dependencies:
|
|
||||||
"@jest/get-type" "30.1.0"
|
|
||||||
|
|
||||||
"@jest/expect-utils@30.2.0":
|
"@jest/expect-utils@30.2.0":
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-30.2.0.tgz#4f95413d4748454fdb17404bf1141827d15e6011"
|
resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-30.2.0.tgz#4f95413d4748454fdb17404bf1141827d15e6011"
|
||||||
|
@ -1148,19 +1141,6 @@
|
||||||
slash "^3.0.0"
|
slash "^3.0.0"
|
||||||
write-file-atomic "^5.0.1"
|
write-file-atomic "^5.0.1"
|
||||||
|
|
||||||
"@jest/types@30.0.5":
|
|
||||||
version "30.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/@jest/types/-/types-30.0.5.tgz#29a33a4c036e3904f1cfd94f6fe77f89d2e1cc05"
|
|
||||||
integrity sha512-aREYa3aku9SSnea4aX6bhKn4bgv3AXkgijoQgbYV3yvbiGt6z+MQ85+6mIhx9DsKW2BuB/cLR/A+tcMThx+KLQ==
|
|
||||||
dependencies:
|
|
||||||
"@jest/pattern" "30.0.1"
|
|
||||||
"@jest/schemas" "30.0.5"
|
|
||||||
"@types/istanbul-lib-coverage" "^2.0.6"
|
|
||||||
"@types/istanbul-reports" "^3.0.4"
|
|
||||||
"@types/node" "*"
|
|
||||||
"@types/yargs" "^17.0.33"
|
|
||||||
chalk "^4.1.2"
|
|
||||||
|
|
||||||
"@jest/types@30.2.0":
|
"@jest/types@30.2.0":
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@jest/types/-/types-30.2.0.tgz#1c678a7924b8f59eafd4c77d56b6d0ba976d62b8"
|
resolved "https://registry.yarnpkg.com/@jest/types/-/types-30.2.0.tgz#1c678a7924b8f59eafd4c77d56b6d0ba976d62b8"
|
||||||
|
@ -2252,6 +2232,11 @@ base64-js@^1.3.1:
|
||||||
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
|
||||||
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
|
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
|
||||||
|
|
||||||
|
baseline-browser-mapping@^2.8.9:
|
||||||
|
version "2.8.10"
|
||||||
|
resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.10.tgz#32eb5e253d633fa3fa3ffb1685fabf41680d9e8a"
|
||||||
|
integrity sha512-uLfgBi+7IBNay8ECBO2mVMGZAc1VgZWEChxm4lv+TobGdG82LnXMjuNGo/BSSZZL4UmkWhxEHP2f5ziLNwGWMA==
|
||||||
|
|
||||||
big.js@^5.2.2:
|
big.js@^5.2.2:
|
||||||
version "5.2.2"
|
version "5.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
|
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
|
||||||
|
@ -2284,14 +2269,15 @@ braces@^3.0.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
fill-range "^7.1.1"
|
fill-range "^7.1.1"
|
||||||
|
|
||||||
browserslist@^4.24.0, browserslist@^4.24.5, browserslist@^4.25.1:
|
browserslist@^4.24.0, browserslist@^4.25.1, browserslist@^4.26.3:
|
||||||
version "4.25.4"
|
version "4.26.3"
|
||||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.25.4.tgz#ebdd0e1d1cf3911834bab3a6cd7b917d9babf5af"
|
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.26.3.tgz#40fbfe2d1cd420281ce5b1caa8840049c79afb56"
|
||||||
integrity sha512-4jYpcjabC606xJ3kw2QwGEZKX0Aw7sgQdZCvIK9dhVSPh76BKo+C+btT1RRofH7B+8iNpEbgGNVWiLki5q93yg==
|
integrity sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-lite "^1.0.30001737"
|
baseline-browser-mapping "^2.8.9"
|
||||||
electron-to-chromium "^1.5.211"
|
caniuse-lite "^1.0.30001746"
|
||||||
node-releases "^2.0.19"
|
electron-to-chromium "^1.5.227"
|
||||||
|
node-releases "^2.0.21"
|
||||||
update-browserslist-db "^1.1.3"
|
update-browserslist-db "^1.1.3"
|
||||||
|
|
||||||
bser@2.1.1:
|
bser@2.1.1:
|
||||||
|
@ -2407,10 +2393,10 @@ camelcase@^6.3.0:
|
||||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
|
||||||
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
|
||||||
|
|
||||||
caniuse-lite@^1.0.30001737:
|
caniuse-lite@^1.0.30001737, caniuse-lite@^1.0.30001746:
|
||||||
version "1.0.30001739"
|
version "1.0.30001746"
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001739.tgz#b34ce2d56bfc22f4352b2af0144102d623a124f4"
|
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001746.tgz#199d20f04f5369825e00ff7067d45d5dfa03aee7"
|
||||||
integrity sha512-y+j60d6ulelrNSwpPyrHdl+9mJnQzHBr08xm48Qno0nSk4h3Qojh+ziv2qE6rXf4k3tadF4o1J/1tAbVm1NtnA==
|
integrity sha512-eA7Ys/DGw+pnkWWSE/id29f2IcPHVoE8wxtvE5JdvD2V28VTDPy1yEeo11Guz0sJ4ZeGRcm3uaTcAqK1LXaphA==
|
||||||
|
|
||||||
ccount@^2.0.0:
|
ccount@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
|
@ -3048,10 +3034,10 @@ eastasianwidth@^0.2.0:
|
||||||
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
|
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
|
||||||
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
|
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
|
||||||
|
|
||||||
electron-to-chromium@^1.5.211:
|
electron-to-chromium@^1.5.211, electron-to-chromium@^1.5.227:
|
||||||
version "1.5.211"
|
version "1.5.228"
|
||||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.211.tgz#749317bf9cf894c06f67980940cf8074e5eb08ca"
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.228.tgz#38b849bc8714bd21fb64f5ad56bf8cfd8638e1e9"
|
||||||
integrity sha512-IGBvimJkotaLzFnwIVgW9/UD/AOJ2tByUmeOrtqBfACSbAw5b1G0XpvdaieKyc7ULmbwXVx+4e4Be8pOPBrYkw==
|
integrity sha512-nxkiyuqAn4MJ1QbobwqJILiDtu/jk14hEAWaMiJmNPh1Z+jqoFlBFZjdXwLWGeVSeu9hGLg6+2G9yJaW8rBIFA==
|
||||||
|
|
||||||
emittery@^0.13.1:
|
emittery@^0.13.1:
|
||||||
version "0.13.1"
|
version "0.13.1"
|
||||||
|
@ -4862,16 +4848,6 @@ jest-config@30.2.0:
|
||||||
slash "^3.0.0"
|
slash "^3.0.0"
|
||||||
strip-json-comments "^3.1.1"
|
strip-json-comments "^3.1.1"
|
||||||
|
|
||||||
jest-diff@30.1.2:
|
|
||||||
version "30.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-30.1.2.tgz#8ff4217e5b63fef49a5b37462999d8f5299a4eb4"
|
|
||||||
integrity sha512-4+prq+9J61mOVXCa4Qp8ZjavdxzrWQXrI80GNxP8f4tkI2syPuPrJgdRPZRrfUTRvIoUwcmNLbqEJy9W800+NQ==
|
|
||||||
dependencies:
|
|
||||||
"@jest/diff-sequences" "30.0.1"
|
|
||||||
"@jest/get-type" "30.1.0"
|
|
||||||
chalk "^4.1.2"
|
|
||||||
pretty-format "30.0.5"
|
|
||||||
|
|
||||||
jest-diff@30.2.0, jest-diff@^30.2.0:
|
jest-diff@30.2.0, jest-diff@^30.2.0:
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-30.2.0.tgz#e3ec3a6ea5c5747f605c9e874f83d756cba36825"
|
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-30.2.0.tgz#e3ec3a6ea5c5747f605c9e874f83d756cba36825"
|
||||||
|
@ -4949,16 +4925,6 @@ jest-leak-detector@30.2.0:
|
||||||
"@jest/get-type" "30.1.0"
|
"@jest/get-type" "30.1.0"
|
||||||
pretty-format "30.2.0"
|
pretty-format "30.2.0"
|
||||||
|
|
||||||
jest-matcher-utils@30.1.2:
|
|
||||||
version "30.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-30.1.2.tgz#3f1b63949f740025aff740c6c6a1b653ae370fbb"
|
|
||||||
integrity sha512-7ai16hy4rSbDjvPTuUhuV8nyPBd6EX34HkBsBcBX2lENCuAQ0qKCPb/+lt8OSWUa9WWmGYLy41PrEzkwRwoGZQ==
|
|
||||||
dependencies:
|
|
||||||
"@jest/get-type" "30.1.0"
|
|
||||||
chalk "^4.1.2"
|
|
||||||
jest-diff "30.1.2"
|
|
||||||
pretty-format "30.0.5"
|
|
||||||
|
|
||||||
jest-matcher-utils@30.2.0:
|
jest-matcher-utils@30.2.0:
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-30.2.0.tgz#69a0d4c271066559ec8b0d8174829adc3f23a783"
|
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-30.2.0.tgz#69a0d4c271066559ec8b0d8174829adc3f23a783"
|
||||||
|
@ -4969,21 +4935,6 @@ jest-matcher-utils@30.2.0:
|
||||||
jest-diff "30.2.0"
|
jest-diff "30.2.0"
|
||||||
pretty-format "30.2.0"
|
pretty-format "30.2.0"
|
||||||
|
|
||||||
jest-message-util@30.1.0:
|
|
||||||
version "30.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-30.1.0.tgz#653a9bb1a33306eddf13455ce0666ba621b767c4"
|
|
||||||
integrity sha512-HizKDGG98cYkWmaLUHChq4iN+oCENohQLb7Z5guBPumYs+/etonmNFlg1Ps6yN9LTPyZn+M+b/9BbnHx3WTMDg==
|
|
||||||
dependencies:
|
|
||||||
"@babel/code-frame" "^7.27.1"
|
|
||||||
"@jest/types" "30.0.5"
|
|
||||||
"@types/stack-utils" "^2.0.3"
|
|
||||||
chalk "^4.1.2"
|
|
||||||
graceful-fs "^4.2.11"
|
|
||||||
micromatch "^4.0.8"
|
|
||||||
pretty-format "30.0.5"
|
|
||||||
slash "^3.0.0"
|
|
||||||
stack-utils "^2.0.6"
|
|
||||||
|
|
||||||
jest-message-util@30.2.0:
|
jest-message-util@30.2.0:
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-30.2.0.tgz#fc97bf90d11f118b31e6131e2b67fc4f39f92152"
|
resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-30.2.0.tgz#fc97bf90d11f118b31e6131e2b67fc4f39f92152"
|
||||||
|
@ -4999,15 +4950,6 @@ jest-message-util@30.2.0:
|
||||||
slash "^3.0.0"
|
slash "^3.0.0"
|
||||||
stack-utils "^2.0.6"
|
stack-utils "^2.0.6"
|
||||||
|
|
||||||
jest-mock@30.0.5:
|
|
||||||
version "30.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-30.0.5.tgz#ef437e89212560dd395198115550085038570bdd"
|
|
||||||
integrity sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ==
|
|
||||||
dependencies:
|
|
||||||
"@jest/types" "30.0.5"
|
|
||||||
"@types/node" "*"
|
|
||||||
jest-util "30.0.5"
|
|
||||||
|
|
||||||
jest-mock@30.2.0:
|
jest-mock@30.2.0:
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-30.2.0.tgz#69f991614eeb4060189459d3584f710845bff45e"
|
resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-30.2.0.tgz#69f991614eeb4060189459d3584f710845bff45e"
|
||||||
|
@ -5132,18 +5074,6 @@ jest-snapshot@30.2.0:
|
||||||
semver "^7.7.2"
|
semver "^7.7.2"
|
||||||
synckit "^0.11.8"
|
synckit "^0.11.8"
|
||||||
|
|
||||||
jest-util@30.0.5:
|
|
||||||
version "30.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-30.0.5.tgz#035d380c660ad5f1748dff71c4105338e05f8669"
|
|
||||||
integrity sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g==
|
|
||||||
dependencies:
|
|
||||||
"@jest/types" "30.0.5"
|
|
||||||
"@types/node" "*"
|
|
||||||
chalk "^4.1.2"
|
|
||||||
ci-info "^4.2.0"
|
|
||||||
graceful-fs "^4.2.11"
|
|
||||||
picomatch "^4.0.2"
|
|
||||||
|
|
||||||
jest-util@30.2.0:
|
jest-util@30.2.0:
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-30.2.0.tgz#5142adbcad6f4e53c2776c067a4db3c14f913705"
|
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-30.2.0.tgz#5142adbcad6f4e53c2776c067a4db3c14f913705"
|
||||||
|
@ -6317,10 +6247,10 @@ node-preload@^0.2.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
process-on-spawn "^1.0.0"
|
process-on-spawn "^1.0.0"
|
||||||
|
|
||||||
node-releases@^2.0.19:
|
node-releases@^2.0.19, node-releases@^2.0.21:
|
||||||
version "2.0.19"
|
version "2.0.21"
|
||||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314"
|
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.21.tgz#f59b018bc0048044be2d4c4c04e4c8b18160894c"
|
||||||
integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==
|
integrity sha512-5b0pgg78U3hwXkCM8Z9b2FJdPZlr9Psr9V2gQPESdGHqbntyFJKFW4r5TeWGFzafGY3hzs1JC62VEQMbl1JFkw==
|
||||||
|
|
||||||
nopt@3.x:
|
nopt@3.x:
|
||||||
version "3.0.6"
|
version "3.0.6"
|
||||||
|
@ -6799,15 +6729,6 @@ prettier@^3.6.0:
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393"
|
||||||
integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==
|
integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==
|
||||||
|
|
||||||
pretty-format@30.0.5:
|
|
||||||
version "30.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-30.0.5.tgz#e001649d472800396c1209684483e18a4d250360"
|
|
||||||
integrity sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==
|
|
||||||
dependencies:
|
|
||||||
"@jest/schemas" "30.0.5"
|
|
||||||
ansi-styles "^5.2.0"
|
|
||||||
react-is "^18.3.1"
|
|
||||||
|
|
||||||
pretty-format@30.2.0, pretty-format@^30.0.0, pretty-format@^30.0.5:
|
pretty-format@30.2.0, pretty-format@^30.0.0, pretty-format@^30.0.5:
|
||||||
version "30.2.0"
|
version "30.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-30.2.0.tgz#2d44fe6134529aed18506f6d11509d8a62775ebe"
|
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-30.2.0.tgz#2d44fe6134529aed18506f6d11509d8a62775ebe"
|
||||||
|
@ -8072,11 +7993,6 @@ unbox-primitive@^1.1.0:
|
||||||
has-symbols "^1.1.0"
|
has-symbols "^1.1.0"
|
||||||
which-boxed-primitive "^1.1.1"
|
which-boxed-primitive "^1.1.1"
|
||||||
|
|
||||||
undici-types@~7.10.0:
|
|
||||||
version "7.10.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350"
|
|
||||||
integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==
|
|
||||||
|
|
||||||
undici-types@~7.13.0:
|
undici-types@~7.13.0:
|
||||||
version "7.13.0"
|
version "7.13.0"
|
||||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.13.0.tgz#a20ba7c0a2be0c97bd55c308069d29d167466bff"
|
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.13.0.tgz#a20ba7c0a2be0c97bd55c308069d29d167466bff"
|
||||||
|
|
Loading…
Reference in New Issue