expose classes needed to create a custom module type

This commit is contained in:
Tobias Koppers 2020-09-24 20:29:08 +02:00
parent fac6c5241f
commit 963d67178c
2 changed files with 28 additions and 1 deletions

View File

@ -154,6 +154,9 @@ module.exports = mergeExports(fn, {
get Generator() {
return require("./Generator");
},
get HotUpdateChunk() {
return require("./HotUpdateChunk");
},
get HotModuleReplacementPlugin() {
return require("./HotModuleReplacementPlugin");
},
@ -351,6 +354,9 @@ module.exports = mergeExports(fn, {
},
runtime: {
get GetChunkFilenameRuntimeModule() {
return require("./runtime/GetChunkFilenameRuntimeModule");
},
get LoadScriptRuntimeModule() {
return require("./runtime/LoadScriptRuntimeModule");
}

23
types.d.ts vendored
View File

@ -3510,6 +3510,23 @@ declare class Generator {
updateHash(hash: Hash, __1: UpdateHashContextGenerator): void;
static byType(map?: any): ByTypeGenerator;
}
declare class GetChunkFilenameRuntimeModule extends RuntimeModule {
constructor(
contentType: string,
name: string,
global: string,
getFilenameForChunk: (
arg0: Chunk
) => string | ((arg0: PathData, arg1: AssetInfo) => string),
allChunks: boolean
);
contentType: string;
global: string;
getFilenameForChunk: (
arg0: Chunk
) => string | ((arg0: PathData, arg1: AssetInfo) => string);
allChunks: boolean;
}
declare interface GroupConfig<T, R> {
getKeys: (arg0: T) => string[];
createGroup: (arg0: string, arg1: (T | R)[], arg2: T[]) => R;
@ -3581,6 +3598,9 @@ declare class HotModuleReplacementPlugin {
apply(compiler: Compiler): void;
static getParserHooks(parser: JavascriptParser): HMRJavascriptParserHooks;
}
declare class HotUpdateChunk extends Chunk {
constructor();
}
declare class HttpUriPlugin {
constructor();
@ -9961,7 +9981,7 @@ declare namespace exports {
};
}
export namespace runtime {
export { LoadScriptRuntimeModule };
export { GetChunkFilenameRuntimeModule, LoadScriptRuntimeModule };
}
export namespace prefetch {
export { ChunkPrefetchPreloadPlugin };
@ -10144,6 +10164,7 @@ declare namespace exports {
ExternalModule,
ExternalsPlugin,
Generator,
HotUpdateChunk,
HotModuleReplacementPlugin,
IgnorePlugin,
JavascriptModulesPlugin,