mirror of https://github.com/webpack/webpack.git
parent
7cc40782b7
commit
ea53a23827
|
@ -1,21 +1,31 @@
|
||||||
import type { RawSourceMap } from "source-map";
|
import type { SourceMap } from "../lib/NormalModule";
|
||||||
import type { Schema } from "schema-utils/declarations/ValidationError";
|
import type { Schema } from "schema-utils/declarations/ValidationError";
|
||||||
import type { AssetInfo, Configuration } from "../lib";
|
import type { AssetInfo } from "../lib/Compilation";
|
||||||
import Compilation from "../lib/Compilation";
|
import type { ResolveOptionsWithDependencyType } from "../lib/ResolverFactory";
|
||||||
import NormalModule, { InputFileSystem } from "../lib/NormalModule";
|
import type Compilation from "../lib/Compilation";
|
||||||
import type { Mode } from "./WebpackOptions";
|
import type Compiler from "../lib/Compiler";
|
||||||
|
import type NormalModule, { InputFileSystem } from "../lib/NormalModule";
|
||||||
import type { Logger } from "../lib/logging/Logger";
|
import type { Logger } from "../lib/logging/Logger";
|
||||||
|
import type {
|
||||||
|
ImportModuleCallback,
|
||||||
|
ImportModuleOptions
|
||||||
|
} from "../lib/dependencies/LoaderPlugin";
|
||||||
|
import type { Resolver } from "enhanced-resolve";
|
||||||
|
|
||||||
export interface NormalModuleLoaderContext {
|
type ResolveCallback = Parameters<Resolver["resolve"]>[4];
|
||||||
|
|
||||||
|
/** These properties are added by the NormalModule */
|
||||||
|
export interface NormalModuleLoaderContext<OptionsType> {
|
||||||
version: number;
|
version: number;
|
||||||
getOptions(schema: Schema): any;
|
getOptions(schema?: Schema): OptionsType;
|
||||||
emitWarning(warning: Error | string): void;
|
emitWarning(warning: Error): void;
|
||||||
emitError(error: Error | string): void;
|
emitError(error: Error): void;
|
||||||
getLogger(name: string): Logger;
|
getLogger(name?: string): Logger;
|
||||||
resolve(context: string, request: string, callback: any): any;
|
resolve(context: string, request: string, callback: ResolveCallback): any;
|
||||||
getResolve(
|
getResolve(
|
||||||
options: Configuration
|
options?: ResolveOptionsWithDependencyType
|
||||||
): (context: string, request: string, callback: any) => Promise<any>;
|
): ((context: string, request: string, callback: ResolveCallback) => void) &
|
||||||
|
((context: string, request: string) => Promise<string>);
|
||||||
emitFile(
|
emitFile(
|
||||||
name: string,
|
name: string,
|
||||||
content: string,
|
content: string,
|
||||||
|
@ -28,17 +38,48 @@ export interface NormalModuleLoaderContext {
|
||||||
contextify: (context: string, request: string) => string;
|
contextify: (context: string, request: string) => string;
|
||||||
};
|
};
|
||||||
rootContext: string;
|
rootContext: string;
|
||||||
webpack?: boolean;
|
fs: InputFileSystem;
|
||||||
sourceMap?: boolean;
|
sourceMap?: boolean;
|
||||||
mode: Mode;
|
mode: "development" | "production" | "none";
|
||||||
|
webpack?: boolean;
|
||||||
_module?: NormalModule;
|
_module?: NormalModule;
|
||||||
_compilation?: Compilation;
|
_compilation?: Compilation;
|
||||||
_compiler?: Compilation.Compiler;
|
_compiler?: Compiler;
|
||||||
fs: InputFileSystem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The types added to LoaderContextBase by https://github.com/webpack/loader-runner */
|
/** These properties are added by the HotModuleReplacementPlugin */
|
||||||
export interface LoaderRunnerLoaderContext {
|
export interface HotModuleReplacementPluginLoaderContext {
|
||||||
|
hot?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** These properties are added by the LoaderPlugin */
|
||||||
|
export interface LoaderPluginLoaderContext {
|
||||||
|
/**
|
||||||
|
* Resolves the given request to a module, applies all configured loaders and calls
|
||||||
|
* back with the generated source, the sourceMap and the module instance (usually an
|
||||||
|
* instance of NormalModule). Use this function if you need to know the source code
|
||||||
|
* of another module to generate the result.
|
||||||
|
*/
|
||||||
|
loadModule(
|
||||||
|
request: string,
|
||||||
|
callback: (
|
||||||
|
err: Error | null,
|
||||||
|
source: string,
|
||||||
|
sourceMap: any,
|
||||||
|
module: NormalModule
|
||||||
|
) => void
|
||||||
|
): void;
|
||||||
|
|
||||||
|
importModule(
|
||||||
|
request: string,
|
||||||
|
options: ImportModuleOptions,
|
||||||
|
callback: ImportModuleCallback
|
||||||
|
): void;
|
||||||
|
importModule(request: string, options?: ImportModuleOptions): Promise<any>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** The properties are added by https://github.com/webpack/loader-runner */
|
||||||
|
export interface LoaderRunnerLoaderContext<OptionsType> {
|
||||||
/**
|
/**
|
||||||
* Add a directory as dependency of the loader result.
|
* Add a directory as dependency of the loader result.
|
||||||
*/
|
*/
|
||||||
|
@ -102,25 +143,9 @@ export interface LoaderRunnerLoaderContext {
|
||||||
*/
|
*/
|
||||||
loaderIndex: number;
|
loaderIndex: number;
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolves the given request to a module, applies all configured loaders and calls
|
|
||||||
* back with the generated source, the sourceMap and the module instance (usually an
|
|
||||||
* instance of NormalModule). Use this function if you need to know the source code
|
|
||||||
* of another module to generate the result.
|
|
||||||
*/
|
|
||||||
loadModule(
|
|
||||||
request: string,
|
|
||||||
callback: (
|
|
||||||
err: Error | null,
|
|
||||||
source: string,
|
|
||||||
sourceMap: any,
|
|
||||||
module: NormalModule
|
|
||||||
) => void
|
|
||||||
): void;
|
|
||||||
|
|
||||||
readonly previousRequest: string;
|
readonly previousRequest: string;
|
||||||
|
|
||||||
readonly query: string;
|
readonly query: string | OptionsType;
|
||||||
|
|
||||||
readonly remainingRequest: string;
|
readonly remainingRequest: string;
|
||||||
|
|
||||||
|
@ -160,10 +185,28 @@ export interface LoaderRunnerLoaderContext {
|
||||||
}[];
|
}[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource file.
|
* The resource path.
|
||||||
* In the example: "/abc/resource.js"
|
* In the example: "/abc/resource.js"
|
||||||
*/
|
*/
|
||||||
resourcePath: string;
|
resourcePath: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The resource query string.
|
||||||
|
* Example: "?query"
|
||||||
|
*/
|
||||||
|
resourceQuery: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The resource fragment.
|
||||||
|
* Example: "#frag"
|
||||||
|
*/
|
||||||
|
resourceFragment: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The resource inclusive query and fragment.
|
||||||
|
* Example: "/abc/resource.js?query#frag"
|
||||||
|
*/
|
||||||
|
resource: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type AdditionalData = {
|
type AdditionalData = {
|
||||||
|
@ -174,28 +217,56 @@ type AdditionalData = {
|
||||||
type WebpackLoaderContextCallback = (
|
type WebpackLoaderContextCallback = (
|
||||||
err: Error | undefined | null,
|
err: Error | undefined | null,
|
||||||
content?: string | Buffer,
|
content?: string | Buffer,
|
||||||
sourceMap?: string | RawSourceMap,
|
sourceMap?: string | SourceMap,
|
||||||
additionalData?: AdditionalData
|
additionalData?: AdditionalData
|
||||||
) => void;
|
) => void;
|
||||||
|
|
||||||
type LoaderContext = NormalModuleLoaderContext & LoaderRunnerLoaderContext;
|
type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
|
||||||
|
LoaderRunnerLoaderContext<OptionsType> &
|
||||||
|
LoaderPluginLoaderContext &
|
||||||
|
HotModuleReplacementPluginLoaderContext;
|
||||||
|
|
||||||
export type LoaderDefinition =
|
type PitchLoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (
|
||||||
| {
|
this: LoaderContext<OptionsType> & ContextAdditions,
|
||||||
(
|
remainingRequest: string,
|
||||||
this: LoaderContext,
|
previousRequest: string,
|
||||||
content: string,
|
data: object
|
||||||
sourceMap?: string | RawSourceMap,
|
) => string | Buffer | Promise<string | Buffer> | void;
|
||||||
additionalData?: AdditionalData
|
|
||||||
): string | Buffer | Promise<string | Buffer> | void;
|
type LoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (
|
||||||
raw?: false;
|
this: LoaderContext<OptionsType> & ContextAdditions,
|
||||||
}
|
content: string,
|
||||||
| {
|
sourceMap?: string | SourceMap,
|
||||||
(
|
additionalData?: AdditionalData
|
||||||
this: LoaderContext,
|
) => string | Buffer | Promise<string | Buffer> | void;
|
||||||
content: Buffer,
|
|
||||||
sourceMap?: string | RawSourceMap,
|
type RawLoaderDefinitionFunction<OptionsType = {}, ContextAdditions = {}> = (
|
||||||
additionalData?: AdditionalData
|
this: LoaderContext<OptionsType> & ContextAdditions,
|
||||||
): string | Buffer | Promise<string | Buffer> | void;
|
content: Buffer,
|
||||||
raw: true;
|
sourceMap?: string | SourceMap,
|
||||||
};
|
additionalData?: AdditionalData
|
||||||
|
) => string | Buffer | Promise<string | Buffer> | void;
|
||||||
|
|
||||||
|
export type LoaderDefinition<
|
||||||
|
OptionsType = {},
|
||||||
|
ContextAdditions = {}
|
||||||
|
> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
||||||
|
raw?: false;
|
||||||
|
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type RawLoaderDefinition<
|
||||||
|
OptionsType = {},
|
||||||
|
ContextAdditions = {}
|
||||||
|
> = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
||||||
|
raw: true;
|
||||||
|
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
|
||||||
|
default?:
|
||||||
|
| RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
|
||||||
|
| LoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
|
raw?: false;
|
||||||
|
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
export type {
|
||||||
|
LoaderModule,
|
||||||
|
RawLoaderDefinition,
|
||||||
|
LoaderDefinition,
|
||||||
|
LoaderDefinitionFunction,
|
||||||
|
PitchLoaderDefinitionFunction,
|
||||||
|
RawLoaderDefinitionFunction,
|
||||||
|
LoaderContext
|
||||||
|
} from "./LoaderContext";
|
|
@ -3,5 +3,6 @@ module.exports = {
|
||||||
FsStats: /^Stats Import fs/,
|
FsStats: /^Stats Import fs/,
|
||||||
Configuration: /^WebpackOptions /
|
Configuration: /^WebpackOptions /
|
||||||
},
|
},
|
||||||
exclude: [/^devServer in WebpackOptions /]
|
exclude: [/^devServer in WebpackOptions /],
|
||||||
|
include: [/^(_module|_compilation|_compiler) in NormalModuleLoaderContext /]
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
const util = require("util");
|
const util = require("util");
|
||||||
const memoize = require("./util/memoize");
|
const memoize = require("./util/memoize");
|
||||||
|
|
||||||
/** @typedef {import("../declarations/LoaderContext").LoaderContext} LoaderContext */
|
|
||||||
/** @typedef {import("../declarations/LoaderContext").LoaderDefinition} LoaderDefinition */
|
|
||||||
/** @typedef {import("../declarations/WebpackOptions").Entry} Entry */
|
/** @typedef {import("../declarations/WebpackOptions").Entry} Entry */
|
||||||
/** @typedef {import("../declarations/WebpackOptions").EntryNormalized} EntryNormalized */
|
/** @typedef {import("../declarations/WebpackOptions").EntryNormalized} EntryNormalized */
|
||||||
/** @typedef {import("../declarations/WebpackOptions").EntryObject} EntryObject */
|
/** @typedef {import("../declarations/WebpackOptions").EntryObject} EntryObject */
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
"style-loader": "^2.0.0",
|
"style-loader": "^2.0.0",
|
||||||
"terser": "^5.5.0",
|
"terser": "^5.5.0",
|
||||||
"toml": "^3.0.0",
|
"toml": "^3.0.0",
|
||||||
"tooling": "webpack/tooling#v1.15.0",
|
"tooling": "webpack/tooling#v1.18.0",
|
||||||
"ts-loader": "^8.0.2",
|
"ts-loader": "^8.0.2",
|
||||||
"typescript": "^4.2.0-beta",
|
"typescript": "^4.2.0-beta",
|
||||||
"url-loader": "^4.1.0",
|
"url-loader": "^4.1.0",
|
||||||
|
|
|
@ -2325,15 +2325,15 @@
|
||||||
"description": "The test property is a cache group name, but using the test option of the cache group could be intended instead.",
|
"description": "The test property is a cache group name, but using the test option of the cache group could be intended instead.",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"instanceof": "Function",
|
"instanceof": "RegExp",
|
||||||
"tsType": "Function"
|
"tsType": "RegExp"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"instanceof": "RegExp",
|
"instanceof": "Function",
|
||||||
"tsType": "RegExp"
|
"tsType": "Function"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -4204,6 +4204,13 @@ declare class HotModuleReplacementPlugin {
|
||||||
apply(compiler: Compiler): void;
|
apply(compiler: Compiler): void;
|
||||||
static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
|
static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* These properties are added by the HotModuleReplacementPlugin
|
||||||
|
*/
|
||||||
|
declare interface HotModuleReplacementPluginLoaderContext {
|
||||||
|
hot?: boolean;
|
||||||
|
}
|
||||||
declare class HotUpdateChunk extends Chunk {
|
declare class HotUpdateChunk extends Chunk {
|
||||||
constructor();
|
constructor();
|
||||||
}
|
}
|
||||||
|
@ -4292,6 +4299,17 @@ type IgnorePluginOptions =
|
||||||
*/
|
*/
|
||||||
checkResource?: (resource: string, context: string) => boolean;
|
checkResource?: (resource: string, context: string) => boolean;
|
||||||
};
|
};
|
||||||
|
declare interface ImportModuleOptions {
|
||||||
|
/**
|
||||||
|
* the target layer
|
||||||
|
*/
|
||||||
|
layer?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the target public path
|
||||||
|
*/
|
||||||
|
publicPath?: string;
|
||||||
|
}
|
||||||
type ImportSource = undefined | null | string | SimpleLiteral | RegExpLiteral;
|
type ImportSource = undefined | null | string | SimpleLiteral | RegExpLiteral;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5745,32 +5763,45 @@ declare class LoadScriptRuntimeModule extends HelperRuntimeModule {
|
||||||
declare interface Loader {
|
declare interface Loader {
|
||||||
[index: string]: any;
|
[index: string]: any;
|
||||||
}
|
}
|
||||||
type LoaderContext = NormalModuleLoaderContext & LoaderRunnerLoaderContext;
|
type LoaderContext<OptionsType> = NormalModuleLoaderContext<OptionsType> &
|
||||||
type LoaderDefinition =
|
LoaderRunnerLoaderContext<OptionsType> &
|
||||||
| {
|
LoaderPluginLoaderContext &
|
||||||
(
|
HotModuleReplacementPluginLoaderContext;
|
||||||
this: LoaderContext,
|
type LoaderDefinition<
|
||||||
content: string,
|
OptionsType = {},
|
||||||
sourceMap?: string | RawSourceMap,
|
ContextAdditions = {}
|
||||||
additionalData?: AdditionalData
|
> = LoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
||||||
): string | void | Buffer | Promise<string | Buffer>;
|
raw?: false;
|
||||||
raw?: false;
|
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
}
|
};
|
||||||
| {
|
declare interface LoaderDefinitionFunction<
|
||||||
(
|
OptionsType = {},
|
||||||
this: LoaderContext,
|
ContextAdditions = {}
|
||||||
content: Buffer,
|
> {
|
||||||
sourceMap?: string | RawSourceMap,
|
(
|
||||||
additionalData?: AdditionalData
|
this: NormalModuleLoaderContext<OptionsType> &
|
||||||
): string | void | Buffer | Promise<string | Buffer>;
|
LoaderRunnerLoaderContext<OptionsType> &
|
||||||
raw: true;
|
LoaderPluginLoaderContext &
|
||||||
};
|
HotModuleReplacementPluginLoaderContext &
|
||||||
|
ContextAdditions,
|
||||||
|
content: string,
|
||||||
|
sourceMap?: string | SourceMap,
|
||||||
|
additionalData?: AdditionalData
|
||||||
|
): string | void | Buffer | Promise<string | Buffer>;
|
||||||
|
}
|
||||||
declare interface LoaderItem {
|
declare interface LoaderItem {
|
||||||
loader: string;
|
loader: string;
|
||||||
options: any;
|
options: any;
|
||||||
ident: null | string;
|
ident: null | string;
|
||||||
type: null | string;
|
type: null | string;
|
||||||
}
|
}
|
||||||
|
declare interface LoaderModule<OptionsType = {}, ContextAdditions = {}> {
|
||||||
|
default?:
|
||||||
|
| RawLoaderDefinitionFunction<OptionsType, ContextAdditions>
|
||||||
|
| LoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
|
raw?: false;
|
||||||
|
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
|
}
|
||||||
declare class LoaderOptionsPlugin {
|
declare class LoaderOptionsPlugin {
|
||||||
constructor(options?: LoaderOptionsPluginOptions);
|
constructor(options?: LoaderOptionsPluginOptions);
|
||||||
options: LoaderOptionsPluginOptions;
|
options: LoaderOptionsPluginOptions;
|
||||||
|
@ -5806,9 +5837,36 @@ declare interface LoaderOptionsPluginOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The types added to LoaderContextBase by https://github.com/webpack/loader-runner
|
* These properties are added by the LoaderPlugin
|
||||||
*/
|
*/
|
||||||
declare interface LoaderRunnerLoaderContext {
|
declare interface LoaderPluginLoaderContext {
|
||||||
|
/**
|
||||||
|
* Resolves the given request to a module, applies all configured loaders and calls
|
||||||
|
* back with the generated source, the sourceMap and the module instance (usually an
|
||||||
|
* instance of NormalModule). Use this function if you need to know the source code
|
||||||
|
* of another module to generate the result.
|
||||||
|
*/
|
||||||
|
loadModule(
|
||||||
|
request: string,
|
||||||
|
callback: (
|
||||||
|
err: null | Error,
|
||||||
|
source: string,
|
||||||
|
sourceMap: any,
|
||||||
|
module: NormalModule
|
||||||
|
) => void
|
||||||
|
): void;
|
||||||
|
importModule(
|
||||||
|
request: string,
|
||||||
|
options: ImportModuleOptions,
|
||||||
|
callback: (err?: Error, exports?: any) => any
|
||||||
|
): void;
|
||||||
|
importModule(request: string, options?: ImportModuleOptions): Promise<any>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The properties are added by https://github.com/webpack/loader-runner
|
||||||
|
*/
|
||||||
|
declare interface LoaderRunnerLoaderContext<OptionsType> {
|
||||||
/**
|
/**
|
||||||
* Add a directory as dependency of the loader result.
|
* Add a directory as dependency of the loader result.
|
||||||
*/
|
*/
|
||||||
|
@ -5828,7 +5886,7 @@ declare interface LoaderRunnerLoaderContext {
|
||||||
async(): (
|
async(): (
|
||||||
err?: null | Error,
|
err?: null | Error,
|
||||||
content?: string | Buffer,
|
content?: string | Buffer,
|
||||||
sourceMap?: string | RawSourceMap,
|
sourceMap?: string | SourceMap,
|
||||||
additionalData?: AdditionalData
|
additionalData?: AdditionalData
|
||||||
) => void;
|
) => void;
|
||||||
|
|
||||||
|
@ -5842,7 +5900,7 @@ declare interface LoaderRunnerLoaderContext {
|
||||||
callback: (
|
callback: (
|
||||||
err?: null | Error,
|
err?: null | Error,
|
||||||
content?: string | Buffer,
|
content?: string | Buffer,
|
||||||
sourceMap?: string | RawSourceMap,
|
sourceMap?: string | SourceMap,
|
||||||
additionalData?: AdditionalData
|
additionalData?: AdditionalData
|
||||||
) => void;
|
) => void;
|
||||||
|
|
||||||
|
@ -5875,24 +5933,8 @@ declare interface LoaderRunnerLoaderContext {
|
||||||
* In the example: in loader1: 0, in loader2: 1
|
* In the example: in loader1: 0, in loader2: 1
|
||||||
*/
|
*/
|
||||||
loaderIndex: number;
|
loaderIndex: number;
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolves the given request to a module, applies all configured loaders and calls
|
|
||||||
* back with the generated source, the sourceMap and the module instance (usually an
|
|
||||||
* instance of NormalModule). Use this function if you need to know the source code
|
|
||||||
* of another module to generate the result.
|
|
||||||
*/
|
|
||||||
loadModule(
|
|
||||||
request: string,
|
|
||||||
callback: (
|
|
||||||
err: null | Error,
|
|
||||||
source: string,
|
|
||||||
sourceMap: any,
|
|
||||||
module: NormalModule
|
|
||||||
) => void
|
|
||||||
): void;
|
|
||||||
readonly previousRequest: string;
|
readonly previousRequest: string;
|
||||||
readonly query: string;
|
readonly query: string | OptionsType;
|
||||||
readonly remainingRequest: string;
|
readonly remainingRequest: string;
|
||||||
readonly request: string;
|
readonly request: string;
|
||||||
|
|
||||||
|
@ -5929,10 +5971,28 @@ declare interface LoaderRunnerLoaderContext {
|
||||||
}[];
|
}[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The resource file.
|
* The resource path.
|
||||||
* In the example: "/abc/resource.js"
|
* In the example: "/abc/resource.js"
|
||||||
*/
|
*/
|
||||||
resourcePath: string;
|
resourcePath: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The resource query string.
|
||||||
|
* Example: "?query"
|
||||||
|
*/
|
||||||
|
resourceQuery: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The resource fragment.
|
||||||
|
* Example: "#frag"
|
||||||
|
*/
|
||||||
|
resourceFragment: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The resource inclusive query and fragment.
|
||||||
|
* Example: "/abc/resource.js?query#frag"
|
||||||
|
*/
|
||||||
|
resource: string;
|
||||||
}
|
}
|
||||||
declare class LoaderTargetPlugin {
|
declare class LoaderTargetPlugin {
|
||||||
constructor(target: string);
|
constructor(target: string);
|
||||||
|
@ -6079,7 +6139,6 @@ declare interface MinChunkSizePluginOptions {
|
||||||
*/
|
*/
|
||||||
minChunkSize: number;
|
minChunkSize: number;
|
||||||
}
|
}
|
||||||
type Mode = "development" | "production" | "none";
|
|
||||||
declare class Module extends DependenciesBlock {
|
declare class Module extends DependenciesBlock {
|
||||||
constructor(type: string, context?: string, layer?: string);
|
constructor(type: string, context?: string, layer?: string);
|
||||||
type: string;
|
type: string;
|
||||||
|
@ -7003,7 +7062,7 @@ declare class NormalModule extends Module {
|
||||||
options: WebpackOptionsNormalized,
|
options: WebpackOptionsNormalized,
|
||||||
compilation: Compilation,
|
compilation: Compilation,
|
||||||
fs: InputFileSystem
|
fs: InputFileSystem
|
||||||
): NormalModuleLoaderContext;
|
): NormalModuleLoaderContext<any>;
|
||||||
getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
|
getCurrentLoader(loaderContext?: any, index?: any): null | LoaderItem;
|
||||||
createSource(
|
createSource(
|
||||||
context: string,
|
context: string,
|
||||||
|
@ -7079,16 +7138,44 @@ declare abstract class NormalModuleFactory extends ModuleFactory {
|
||||||
createGenerator(type?: any, generatorOptions?: object): any;
|
createGenerator(type?: any, generatorOptions?: object): any;
|
||||||
getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
|
getResolver(type?: any, resolveOptions?: any): ResolverWithOptions;
|
||||||
}
|
}
|
||||||
declare interface NormalModuleLoaderContext {
|
|
||||||
|
/**
|
||||||
|
* These properties are added by the NormalModule
|
||||||
|
*/
|
||||||
|
declare interface NormalModuleLoaderContext<OptionsType> {
|
||||||
version: number;
|
version: number;
|
||||||
getOptions(schema: Schema): any;
|
getOptions(
|
||||||
emitWarning(warning: string | Error): void;
|
schema?:
|
||||||
emitError(error: string | Error): void;
|
| (JSONSchema4 & Extend)
|
||||||
getLogger(name: string): WebpackLogger;
|
| (JSONSchema6 & Extend)
|
||||||
resolve(context: string, request: string, callback?: any): any;
|
| (JSONSchema7 & Extend)
|
||||||
|
): OptionsType;
|
||||||
|
emitWarning(warning: Error): void;
|
||||||
|
emitError(error: Error): void;
|
||||||
|
getLogger(name?: string): WebpackLogger;
|
||||||
|
resolve(
|
||||||
|
context: string,
|
||||||
|
request: string,
|
||||||
|
callback: (
|
||||||
|
arg0: null | Error,
|
||||||
|
arg1?: string | false,
|
||||||
|
arg2?: ResolveRequest
|
||||||
|
) => void
|
||||||
|
): any;
|
||||||
getResolve(
|
getResolve(
|
||||||
options: Configuration
|
options?: ResolveOptionsWithDependencyType
|
||||||
): (context: string, request: string, callback?: any) => Promise<any>;
|
): {
|
||||||
|
(
|
||||||
|
context: string,
|
||||||
|
request: string,
|
||||||
|
callback: (
|
||||||
|
arg0: null | Error,
|
||||||
|
arg1?: string | false,
|
||||||
|
arg2?: ResolveRequest
|
||||||
|
) => void
|
||||||
|
): void;
|
||||||
|
(context: string, request: string): Promise<string>;
|
||||||
|
};
|
||||||
emitFile(
|
emitFile(
|
||||||
name: string,
|
name: string,
|
||||||
content: string,
|
content: string,
|
||||||
|
@ -7101,10 +7188,13 @@ declare interface NormalModuleLoaderContext {
|
||||||
contextify: (context: string, request: string) => string;
|
contextify: (context: string, request: string) => string;
|
||||||
};
|
};
|
||||||
rootContext: string;
|
rootContext: string;
|
||||||
webpack?: boolean;
|
|
||||||
sourceMap?: boolean;
|
|
||||||
mode: Mode;
|
|
||||||
fs: InputFileSystem;
|
fs: InputFileSystem;
|
||||||
|
sourceMap?: boolean;
|
||||||
|
mode: "development" | "production" | "none";
|
||||||
|
webpack?: boolean;
|
||||||
|
_module?: NormalModule;
|
||||||
|
_compilation?: Compilation;
|
||||||
|
_compiler?: Compiler;
|
||||||
}
|
}
|
||||||
declare class NormalModuleReplacementPlugin {
|
declare class NormalModuleReplacementPlugin {
|
||||||
/**
|
/**
|
||||||
|
@ -8225,6 +8315,21 @@ declare interface PerformanceOptions {
|
||||||
*/
|
*/
|
||||||
maxEntrypointSize?: number;
|
maxEntrypointSize?: number;
|
||||||
}
|
}
|
||||||
|
declare interface PitchLoaderDefinitionFunction<
|
||||||
|
OptionsType = {},
|
||||||
|
ContextAdditions = {}
|
||||||
|
> {
|
||||||
|
(
|
||||||
|
this: NormalModuleLoaderContext<OptionsType> &
|
||||||
|
LoaderRunnerLoaderContext<OptionsType> &
|
||||||
|
LoaderPluginLoaderContext &
|
||||||
|
HotModuleReplacementPluginLoaderContext &
|
||||||
|
ContextAdditions,
|
||||||
|
remainingRequest: string,
|
||||||
|
previousRequest: string,
|
||||||
|
data: object
|
||||||
|
): string | void | Buffer | Promise<string | Buffer>;
|
||||||
|
}
|
||||||
type Plugin =
|
type Plugin =
|
||||||
| { apply: (arg0: Resolver) => void }
|
| { apply: (arg0: Resolver) => void }
|
||||||
| ((this: Resolver, arg1: Resolver) => void);
|
| ((this: Resolver, arg1: Resolver) => void);
|
||||||
|
@ -8441,6 +8546,28 @@ declare interface RawChunkGroupOptions {
|
||||||
preloadOrder?: number;
|
preloadOrder?: number;
|
||||||
prefetchOrder?: number;
|
prefetchOrder?: number;
|
||||||
}
|
}
|
||||||
|
type RawLoaderDefinition<
|
||||||
|
OptionsType = {},
|
||||||
|
ContextAdditions = {}
|
||||||
|
> = RawLoaderDefinitionFunction<OptionsType, ContextAdditions> & {
|
||||||
|
raw: true;
|
||||||
|
pitch?: PitchLoaderDefinitionFunction<OptionsType, ContextAdditions>;
|
||||||
|
};
|
||||||
|
declare interface RawLoaderDefinitionFunction<
|
||||||
|
OptionsType = {},
|
||||||
|
ContextAdditions = {}
|
||||||
|
> {
|
||||||
|
(
|
||||||
|
this: NormalModuleLoaderContext<OptionsType> &
|
||||||
|
LoaderRunnerLoaderContext<OptionsType> &
|
||||||
|
LoaderPluginLoaderContext &
|
||||||
|
HotModuleReplacementPluginLoaderContext &
|
||||||
|
ContextAdditions,
|
||||||
|
content: Buffer,
|
||||||
|
sourceMap?: string | SourceMap,
|
||||||
|
additionalData?: AdditionalData
|
||||||
|
): string | void | Buffer | Promise<string | Buffer>;
|
||||||
|
}
|
||||||
declare class RawSource extends Source {
|
declare class RawSource extends Source {
|
||||||
constructor(source: string | Buffer, convertToString?: boolean);
|
constructor(source: string | Buffer, convertToString?: boolean);
|
||||||
isBuffer(): boolean;
|
isBuffer(): boolean;
|
||||||
|
@ -10305,6 +10432,7 @@ declare interface SourceData {
|
||||||
declare interface SourceLike {
|
declare interface SourceLike {
|
||||||
source(): string | Buffer;
|
source(): string | Buffer;
|
||||||
}
|
}
|
||||||
|
type SourceMap = Omit<RawSourceMap, "version"> & { version: number };
|
||||||
declare class SourceMapDevToolPlugin {
|
declare class SourceMapDevToolPlugin {
|
||||||
constructor(options?: SourceMapDevToolPluginOptions);
|
constructor(options?: SourceMapDevToolPluginOptions);
|
||||||
sourceMapFilename: string | false;
|
sourceMapFilename: string | false;
|
||||||
|
@ -12081,8 +12209,6 @@ declare namespace exports {
|
||||||
WebpackError,
|
WebpackError,
|
||||||
WebpackOptionsApply,
|
WebpackOptionsApply,
|
||||||
WebpackOptionsDefaulter,
|
WebpackOptionsDefaulter,
|
||||||
LoaderContext,
|
|
||||||
LoaderDefinition,
|
|
||||||
Entry,
|
Entry,
|
||||||
EntryNormalized,
|
EntryNormalized,
|
||||||
EntryObject,
|
EntryObject,
|
||||||
|
@ -12115,7 +12241,14 @@ declare namespace exports {
|
||||||
StatsModuleReason,
|
StatsModuleReason,
|
||||||
StatsModuleTraceDependency,
|
StatsModuleTraceDependency,
|
||||||
StatsModuleTraceItem,
|
StatsModuleTraceItem,
|
||||||
StatsProfile
|
StatsProfile,
|
||||||
|
LoaderModule,
|
||||||
|
RawLoaderDefinition,
|
||||||
|
LoaderDefinition,
|
||||||
|
LoaderDefinitionFunction,
|
||||||
|
PitchLoaderDefinitionFunction,
|
||||||
|
RawLoaderDefinitionFunction,
|
||||||
|
LoaderContext
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
20
yarn.lock
20
yarn.lock
|
@ -1226,6 +1226,16 @@ ajv@^7.0.2:
|
||||||
require-from-string "^2.0.2"
|
require-from-string "^2.0.2"
|
||||||
uri-js "^4.2.2"
|
uri-js "^4.2.2"
|
||||||
|
|
||||||
|
ajv@^8.1.0:
|
||||||
|
version "8.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.1.0.tgz#45d5d3d36c7cdd808930cc3e603cf6200dbeb736"
|
||||||
|
integrity sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ==
|
||||||
|
dependencies:
|
||||||
|
fast-deep-equal "^3.1.1"
|
||||||
|
json-schema-traverse "^1.0.0"
|
||||||
|
require-from-string "^2.0.2"
|
||||||
|
uri-js "^4.2.2"
|
||||||
|
|
||||||
amdefine@>=0.0.4:
|
amdefine@>=0.0.4:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
|
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
|
||||||
|
@ -6138,7 +6148,7 @@ terser-webpack-plugin@^5.1.1:
|
||||||
source-map "^0.6.1"
|
source-map "^0.6.1"
|
||||||
terser "^5.5.1"
|
terser "^5.5.1"
|
||||||
|
|
||||||
terser@^5.5.0, terser@^5.5.1:
|
terser@^5.5.0, terser@^5.5.1, terser@^5.6.1:
|
||||||
version "5.6.1"
|
version "5.6.1"
|
||||||
resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.1.tgz#a48eeac5300c0a09b36854bf90d9c26fb201973c"
|
resolved "https://registry.yarnpkg.com/terser/-/terser-5.6.1.tgz#a48eeac5300c0a09b36854bf90d9c26fb201973c"
|
||||||
integrity sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==
|
integrity sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==
|
||||||
|
@ -6253,14 +6263,16 @@ toml@^3.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee"
|
resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee"
|
||||||
integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==
|
integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==
|
||||||
|
|
||||||
tooling@webpack/tooling#v1.15.0:
|
tooling@webpack/tooling#v1.18.0:
|
||||||
version "1.15.0"
|
version "1.18.0"
|
||||||
resolved "https://codeload.github.com/webpack/tooling/tar.gz/1c8c975ada1d94d011a4bc00fb149b168cc60580"
|
resolved "https://codeload.github.com/webpack/tooling/tar.gz/27496b1099c136e4a8bd69b6d4991c3a493d4a4c"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@yarnpkg/lockfile" "^1.1.0"
|
"@yarnpkg/lockfile" "^1.1.0"
|
||||||
|
ajv "^8.1.0"
|
||||||
commondir "^1.0.1"
|
commondir "^1.0.1"
|
||||||
glob "^7.1.6"
|
glob "^7.1.6"
|
||||||
json-schema-to-typescript "^9.1.1"
|
json-schema-to-typescript "^9.1.1"
|
||||||
|
terser "^5.6.1"
|
||||||
yargs "^16.1.1"
|
yargs "^16.1.1"
|
||||||
|
|
||||||
tough-cookie@^2.3.3, tough-cookie@~2.5.0:
|
tough-cookie@^2.3.3, tough-cookie@~2.5.0:
|
||||||
|
|
Loading…
Reference in New Issue