mirror of https://github.com/webpack/webpack.git
refactor: fix types
This commit is contained in:
parent
7176437d19
commit
591d3f4bd4
|
@ -221,7 +221,7 @@ module.exports = class ImportMetaContextDependencyParserPlugin {
|
||||||
}
|
}
|
||||||
case "fetchPriority": {
|
case "fetchPriority": {
|
||||||
const expr = parser.evaluateExpression(
|
const expr = parser.evaluateExpression(
|
||||||
/** @type {ExpressionNode} */ (prop.value)
|
/** @type {Expression} */ (prop.value)
|
||||||
);
|
);
|
||||||
if (expr.isBoolean()) {
|
if (expr.isBoolean()) {
|
||||||
groupOptions.fetchPriority = "auto";
|
groupOptions.fetchPriority = "auto";
|
||||||
|
@ -229,7 +229,10 @@ module.exports = class ImportMetaContextDependencyParserPlugin {
|
||||||
expr.isString() &&
|
expr.isString() &&
|
||||||
["high", "low", "auto"].includes(expr.string)
|
["high", "low", "auto"].includes(expr.string)
|
||||||
) {
|
) {
|
||||||
groupOptions.fetchPriority = expr.string;
|
groupOptions.fetchPriority =
|
||||||
|
/** @type {RawChunkGroupOptions["fetchPriority"]} */ (
|
||||||
|
expr.string
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
errors.push(
|
errors.push(
|
||||||
createPropertyParseError(
|
createPropertyParseError(
|
||||||
|
|
|
@ -8,9 +8,9 @@ const RuntimeGlobals = require("../RuntimeGlobals");
|
||||||
const RuntimeModule = require("../RuntimeModule");
|
const RuntimeModule = require("../RuntimeModule");
|
||||||
const Template = require("../Template");
|
const Template = require("../Template");
|
||||||
|
|
||||||
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
|
||||||
/** @typedef {import("../Chunk")} Chunk */
|
/** @typedef {import("../Chunk")} Chunk */
|
||||||
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
|
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
|
||||||
|
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
|
||||||
|
|
||||||
class ChunkFetchPriorityFunctionRuntimeModule extends RuntimeModule {
|
class ChunkFetchPriorityFunctionRuntimeModule extends RuntimeModule {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,9 +12,9 @@ const ChunkPrefetchStartupRuntimeModule = require("./ChunkPrefetchStartupRuntime
|
||||||
const ChunkPrefetchTriggerRuntimeModule = require("./ChunkPrefetchTriggerRuntimeModule");
|
const ChunkPrefetchTriggerRuntimeModule = require("./ChunkPrefetchTriggerRuntimeModule");
|
||||||
const ChunkPreloadTriggerRuntimeModule = require("./ChunkPreloadTriggerRuntimeModule");
|
const ChunkPreloadTriggerRuntimeModule = require("./ChunkPreloadTriggerRuntimeModule");
|
||||||
|
|
||||||
/** @typedef {import("../Compiler")} Compiler */
|
|
||||||
/** @typedef {import("../Chunk")} Chunk */
|
/** @typedef {import("../Chunk")} Chunk */
|
||||||
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
|
/** @typedef {import("../ChunkGroup").RawChunkGroupOptions} RawChunkGroupOptions */
|
||||||
|
/** @typedef {import("../Compiler")} Compiler */
|
||||||
|
|
||||||
class ChunkPrefetchPreloadPlugin {
|
class ChunkPrefetchPreloadPlugin {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9905,7 +9905,7 @@ declare interface ProvidesObject {
|
||||||
declare interface RawChunkGroupOptions {
|
declare interface RawChunkGroupOptions {
|
||||||
preloadOrder?: number;
|
preloadOrder?: number;
|
||||||
prefetchOrder?: number;
|
prefetchOrder?: number;
|
||||||
fetchPriority?: string;
|
fetchPriority?: "auto" | "low" | "high";
|
||||||
}
|
}
|
||||||
type RawLoaderDefinition<
|
type RawLoaderDefinition<
|
||||||
OptionsType = {},
|
OptionsType = {},
|
||||||
|
|
Loading…
Reference in New Issue