diff --git a/types/tapable/index.d.ts b/types/tapable/index.d.ts index 15ab768e69..c044a245ce 100644 --- a/types/tapable/index.d.ts +++ b/types/tapable/index.d.ts @@ -241,25 +241,31 @@ export interface Tap { context: boolean; } -export class Hook { +export class Hook { constructor(...args: any[]); + taps: any[]; + interceptors: any[]; + call: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any; + promise:(arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => Promise; + callAsync: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any; + compile(options: HookCompileOptions) : Function; - tap: (name: string | Tap, fn: (context: TContext, ...args: any[]) => any) => void; - tapAsync: (name: string | Tap, fn: (context: TContext, ...args: any[]) => void) => void; - tapPromise: (name: string | Tap, fn: (context: TContext, ...args: any[]) => Promise) => void; + tap: (name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => any) => void; + tapAsync: (name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => void) => void; + tapPromise: (name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => Promise) => void; intercept: (interceptor: HookInterceptor) => void; } -export class SyncHook extends Hook {} -export class SyncBailHook extends Hook {} -export class SyncLoopHook extends Hook {} -export class SyncWaterfallHook extends Hook {} +export class SyncHook extends Hook {} +export class SyncBailHook extends Hook {} +export class SyncLoopHook extends Hook {} +export class SyncWaterfallHook extends Hook {} -export class AsyncParallelHook extends Hook {} -export class AsyncParallelBailHook extends Hook {} -export class AsyncSeriesHook extends Hook {} -export class AsyncSeriesBailHook extends Hook {} -export class AsyncSeriesWaterfallHook extends Hook {} +export class AsyncParallelHook extends Hook {} +export class AsyncParallelBailHook extends Hook {} +export class AsyncSeriesHook extends Hook {} +export class AsyncSeriesBailHook extends Hook {} +export class AsyncSeriesWaterfallHook extends Hook {} export class HookInterceptor { call: (...args: any[]) => void; @@ -269,15 +275,15 @@ export class HookInterceptor { context: boolean; } -export class HookMap { - get: (key: any) => Hook | undefined; - for: (key: any) => Hook; - tap: (key: any, name: string | Tap, fn: (context: TContext, ...args: any[]) => any) => void; - tapAsync: (key: any, name: string | Tap, fn: (context: TContext, ...args: any[]) => void) => void; - tapPromise: (key: any, name: string | Tap, fn: (context: any, ...args: any[]) => Promise) => void; - intercept: (interceptor: HookMapInterceptor) => TContext; +export class HookMap { + get: (key: any) => Hook | undefined; + for: (key: any) => Hook; + tap: (key: any, name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => any) => void; + tapAsync: (key: any, name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => void) => void; + tapPromise: (key: any, name: string | Tap, fn: (arg1: T1, arg2: T2, arg3: T3, ...args: any[]) => Promise) => void; + intercept: (interceptor: HookMapInterceptor) => void; } -export class HookMapInterceptor { - factory: (key: any, hook: Hook) => Hook; +export class HookMapInterceptor { + factory: (key: any, hook: Hook) => Hook; } diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index dc5bdcc80f..5f7d31b20b 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -601,316 +601,358 @@ declare namespace webpack { portableRecords?: boolean; } } + namespace compilation { + class Asset { + } - class Chunk { - constructor(name: string); - id: any; - ids: any; - debugId: number; - name: any; - entryModule: any; - files: any[]; - rendered: boolean; - hash: any; - renderedHash: any; - chunkReason: any; - extraAsync: boolean; + class Module { + } - hasRuntime(): boolean; - canBeInitial(): boolean; - isOnlyInitial(): boolean; - hasEntryModule(): boolean; + class Record { + } - addModule(module: any): boolean; - removeModule(module: any): boolean; - setModules(modules: any): void; - getNumberOfModules(): number; - modulesIterable: any[]; + class Chunk { + constructor(name: string); + id: any; + ids: any; + debugId: number; + name: any; + entryModule: any; + files: any[]; + rendered: boolean; + hash: any; + renderedHash: any; + chunkReason: any; + extraAsync: boolean; - addGroup(chunkGroup: any): boolean; - removeGroup(chunkGroup: any): boolean; - isInGroup(chunkGroup: any): boolean; - getNumberOfGroups(): number; - groupsIterable: any[]; + hasRuntime(): boolean; + canBeInitial(): boolean; + isOnlyInitial(): boolean; + hasEntryModule(): boolean; - compareTo(otherChunk: any): -1 | 0 | 1; - containsModule(module: any): boolean; - getModules(): any[]; - getModulesIdent(): any[]; - remove(reason: any): void; - moveModule(module: any, otherChunk: any): void; - integrate(otherChunk: any, reason: any): boolean; - split(newChunk: any): void; - isEmpty(): boolean; - updateHash(hash: any): void; - canBeIntegrated(otherChunk: any): boolean; - addMultiplierAndOverhead(size: number, options: any): number; - modulesSize(): number; - size(options: any): number; - integratedSize(otherChunk: any, options: any): number; - // tslint:disable-next-line:ban-types - sortModules(sortByFn: Function): void; - getAllAsyncChunks(): Set; - getChunkMaps(realHash: any): { hash: any, name: any }; - // tslint:disable-next-line:ban-types - getChunkModuleMaps(filterFn: Function): { id: any, hash: any }; - // tslint:disable-next-line:ban-types - hasModuleInGraph(filterFn: Function, filterChunkFn: Function): boolean; - toString(): string; + addModule(module: any): boolean; + removeModule(module: any): boolean; + setModules(modules: any): void; + getNumberOfModules(): number; + modulesIterable: any[]; + + addGroup(chunkGroup: any): boolean; + removeGroup(chunkGroup: any): boolean; + isInGroup(chunkGroup: any): boolean; + getNumberOfGroups(): number; + groupsIterable: any[]; + + compareTo(otherChunk: any): -1 | 0 | 1; + containsModule(module: any): boolean; + getModules(): any[]; + getModulesIdent(): any[]; + remove(reason: any): void; + moveModule(module: any, otherChunk: any): void; + integrate(otherChunk: any, reason: any): boolean; + split(newChunk: any): void; + isEmpty(): boolean; + updateHash(hash: any): void; + canBeIntegrated(otherChunk: any): boolean; + addMultiplierAndOverhead(size: number, options: any): number; + modulesSize(): number; + size(options: any): number; + integratedSize(otherChunk: any, options: any): number; + // tslint:disable-next-line:ban-types + sortModules(sortByFn: Function): void; + getAllAsyncChunks(): Set; + getChunkMaps(realHash: any): { hash: any, name: any }; + // tslint:disable-next-line:ban-types + getChunkModuleMaps(filterFn: Function): { id: any, hash: any }; + // tslint:disable-next-line:ban-types + hasModuleInGraph(filterFn: Function, filterChunkFn: Function): boolean; + toString(): string; + } + + class ChunkGroup { + } + + class ChunkHash { + } + + class Dependency { + constructor(); + getResourceIdentifier(): any; + getReference(): any; + getExports(): any; + getWarnings(): any; + getErrors(): any; + updateHash(hash: any): void; + disconnect(): void; + static compare(a: any, b: any): any; + } + + interface NormalModuleFactoryHooks { + resolver: SyncWaterfallHook; + factory: SyncWaterfallHook; + beforeResolve: AsyncSeriesWaterfallHook; + afterResolve: AsyncSeriesWaterfallHook; + createModule: SyncBailHook; + module: SyncWaterfallHook; + createParser: HookMap; + parser: HookMap; + createGenerator: HookMap; + generator: HookMap; + } + + class NormalModuleFactory extends Tapable { + hooks: NormalModuleFactoryHooks; + } + + interface ContextModuleFactoryHooks { + beforeResolve: AsyncSeriesWaterfallHook; + afterResolve: AsyncSeriesWaterfallHook; + contextModuleFiles: SyncWaterfallHook; + alternatives: AsyncSeriesWaterfallHook; + } + + class ContextModuleFactory extends Tapable { + hooks: ContextModuleFactoryHooks; + } + + class DllModuleFactory extends Tapable { + hooks: {}; + } + + interface CompilationHooks { + buildModule: SyncHook; + rebuildModule: SyncHook; + failedModule: SyncHook; + succeedModule: SyncHook; + + finishModules: SyncHook; + finishRebuildingModule: SyncHook; + + unseal: SyncHook; + seal: SyncHook; + + optimizeDependenciesBasic: SyncBailHook; + optimizeDependencies: SyncBailHook; + optimizeDependenciesAdvanced: SyncBailHook; + afterOptimizeDependencies: SyncHook; + + optimize: SyncHook; + + optimizeModulesBasic: SyncBailHook; + optimizeModules: SyncBailHook; + optimizeModulesAdvanced: SyncBailHook; + afterOptimizeModules: SyncHook; + + optimizeChunksBasic: SyncBailHook; + optimizeChunks: SyncBailHook; + optimizeChunksAdvanced: SyncBailHook; + afterOptimizeChunks: SyncHook; + + optimizeTree: AsyncSeriesHook; + afterOptimizeTree: SyncHook; + + optimizeChunkModulesBasic: SyncBailHook; + optimizeChunkModules: SyncBailHook; + optimizeChunkModulesAdvanced: SyncBailHook; + afterOptimizeChunkModules: SyncHook; + shouldRecord: SyncBailHook; + + reviveModules: SyncHook; + optimizeModuleOrder: SyncHook; + advancedOptimizeModuleOrder: SyncHook; + beforeModuleIds: SyncHook; + moduleIds: SyncHook; + optimizeModuleIds: SyncHook; + afterOptimizeModuleIds: SyncHook; + + reviveChunks: SyncHook; + optimizeChunkOrder: SyncHook; + beforeChunkIds: SyncHook; + optimizeChunkIds: SyncHook; + afterOptimizeChunkIds: SyncHook; + + recordModules: SyncHook; + recordChunks: SyncHook; + + beforeHash: SyncHook; + afterHash: SyncHook; + + recordHash: SyncHook; + + record: SyncHook; + + beforeModuleAssets: SyncHook; + shouldGenerateChunkAssets: SyncBailHook; + beforeChunkAssets: SyncHook; + additionalChunkAssets: SyncHook; + + records: SyncHook; + + additionalAssets: AsyncSeriesHook; + optimizeChunkAssets: AsyncSeriesHook; + afterOptimizeChunkAssets: SyncHook; + optimizeAssets: AsyncSeriesHook; + afterOptimizeAssets: SyncHook; + + needAdditionalSeal: SyncBailHook; + afterSeal: AsyncSeriesHook; + + chunkHash: SyncHook; + moduleAsset: SyncHook; + chunkAsset: SyncHook; + + assetPath: SyncWaterfallHook; + + needAdditionalPass: SyncBailHook; + childCompiler: SyncHook; + + normalModuleLoader: SyncHook; + + optimizeExtractedChunksBasic: SyncBailHook; + optimizeExtractedChunks: SyncBailHook; + optimizeExtractedChunksAdvanced: SyncBailHook; + afterOptimizeExtractedChunks: SyncHook; + } + + interface CompilationModule { + module: any; + issuer: boolean; + build: boolean; + dependencies: boolean; + } + + class MainTemplate extends Tapable {} + class ChunkTemplate extends Tapable {} + class HotUpdateChunkTemplate extends Tapable {} + class RuntimeTemplate {} + + interface ModuleTemplateHooks { + content: SyncWaterfallHook; + module: SyncWaterfallHook; + render: SyncWaterfallHook; + package: SyncWaterfallHook; + hash: SyncHook; + } + + class ModuleTemplate extends Tapable { + hooks: ModuleTemplateHooks; + } + + class Compilation extends Tapable { + hooks: CompilationHooks; + compiler: Compiler; + + resolverFactory: any; + inputFileSystem: any; + requestShortener: any; + + outputOptions: any; + bail: any; + profile: any; + performance: any; + + mainTemplate: MainTemplate; + chunkTemplate: ChunkTemplate; + hotUpdateChunkTemplate: HotUpdateChunkTemplate; + runtimeTemplate: RuntimeTemplate; + moduleTemplates: { + javascript: ModuleTemplate; + webassembly: ModuleTemplate; + }; + + entries: any[]; + _preparedEntrypoints: any[]; + entrypoints: Map; + chunks: any[]; + chunkGroups: any[]; + namedChunkGroups: Map; + namedChunks: Map; + modules: any[]; + _modules: Map; + cache: any; + records: any; + nextFreeModuleIndex: any; + nextFreeModuleIndex2: any; + additionalChunkAssets: any[]; + assets: any; + errors: any[]; + warnings: any[]; + children: any[]; + dependencyFactories: Map; + dependencyTemplates: Map; + childrenCounters: any; + usedChunkIds: any; + usedModuleIds: any; + getStats(): Stats; + addModule(module: CompilationModule, cacheGroup: any): any; + // getModule(module) + // findModule(identifier) + // waitForBuildingFinished(module, callback) + // buildModule(module, optional, origin, dependencies, thisCallback) + // processModuleDependencies(module, callback) + // addModuleDependencies(module, dependencies, bail, cacheGroup, recursive, callback) + // tslint:disable-next-line:ban-types + addEntry(context: any, entry: any, name: any, callback: Function): void; + // prefetch(context, dependency, callback) + // rebuildModule(module, thisCallback) + // finish() + // unseal() + // seal(callback) + // sortModules(modules) + // reportDependencyErrorsAndWarnings(module, blocks) + // addChunkInGroup(name, module, loc, request) + // addChunk(name) + // assignIndex(module) + // assignDepth(module) + // processDependenciesBlocksForChunkGroups(inputChunkGroups) + // removeReasonsOfDependencyBlock(module, block) + // patchChunksAfterReasonRemoval(module, chunk) + // removeChunkFromDependencies(block, chunk) + // applyModuleIds() + // applyChunkIds() + // sortItemsWithModuleIds() + // sortItemsWithChunkIds() + // summarizeDependencies() + // createHash() + // modifyHash(update) + // createModuleAssets() + // createChunkAssets() + getPath(filename: string, data: {hash?: any, chunk?: any, filename?: string, basename?: string, query?: any}): string; + // createChildCompiler(name, outputOptions, plugins) + // checkConstraints() + + /** + * @deprecated Compilation.applyPlugins is deprecated. Use new API on `.hooks` instead + */ + applyPlugins(name: string, ...args: any[]): void; + } + + interface CompilerHooks { + shouldEmit: SyncBailHook; + done: AsyncSeriesHook; + additionalPass: AsyncSeriesHook; + beforeRun: AsyncSeriesHook; + run: AsyncSeriesHook; + emit: AsyncSeriesHook; + afterEmit: AsyncSeriesHook; + thisCompilation: SyncHook; + compilation: SyncHook; + normalModuleFactory: SyncHook; + contextModuleFactory: SyncHook; + beforeCompile: AsyncSeriesHook<{}>; + compile: SyncHook<{}>; + make: AsyncParallelHook; + afterCompile: AsyncSeriesHook; + watchRun: AsyncSeriesHook; + failed: SyncHook; + invalid: SyncHook; + watchClose: SyncHook; + environment: SyncHook; + afterEnvironment: SyncHook; + afterPlugins: SyncHook; + afterResolvers: SyncHook; + entryOption: SyncBailHook; + } } - - class Dependency { - constructor(); - getResourceIdentifier(): any; - getReference(): any; - getExports(): any; - getWarnings(): any; - getErrors(): any; - updateHash(hash: any): void; - disconnect(): void; - static compare(a: any, b: any): any; - } - - interface NormalModuleFactoryHooks { - resolver: SyncWaterfallHook; - factory: SyncWaterfallHook; - beforeResolve: AsyncSeriesWaterfallHook; - afterResolve: AsyncSeriesWaterfallHook; - createModule: SyncBailHook; - module: SyncWaterfallHook; - createParser: HookMap; - parser: HookMap; - createGenerator: HookMap; - generator: HookMap; - } - - class NormalModuleFactory extends Tapable { - hooks: NormalModuleFactoryHooks; - } - - interface ContextModuleFactoryHooks { - beforeResolve: AsyncSeriesWaterfallHook; - afterResolve: AsyncSeriesWaterfallHook; - contextModuleFiles: SyncWaterfallHook; - alternatives: AsyncSeriesWaterfallHook; - } - - class ContextModuleFactory extends Tapable { - hooks: ContextModuleFactoryHooks; - } - - class DllModuleFactory extends Tapable { - hooks: {}; - } - - interface CompilationHooks { - buildModule: SyncHook; - rebuildModule: SyncHook; - failedModule: SyncHook; - succeedModule: SyncHook; - - finishModules: SyncHook; - finishRebuildingModule: SyncHook; - - unseal: SyncHook; - seal: SyncHook; - - optimizeDependenciesBasic: SyncBailHook; - optimizeDependencies: SyncBailHook; - optimizeDependenciesAdvanced: SyncBailHook; - afterOptimizeDependencies: SyncHook; - - optimize: SyncHook; - - optimizeModulesBasic: SyncBailHook; - optimizeModules: SyncBailHook; - optimizeModulesAdvanced: SyncBailHook; - afterOptimizeModules: SyncHook; - - optimizeChunksBasic: SyncBailHook; - optimizeChunks: SyncBailHook; - optimizeChunksAdvanced: SyncBailHook; - afterOptimizeChunks: SyncHook; - - optimizeTree: AsyncSeriesHook; - afterOptimizeTree: SyncHook; - - optimizeChunkModulesBasic: SyncBailHook; - optimizeChunkModules: SyncBailHook; - optimizeChunkModulesAdvanced: SyncBailHook; - afterOptimizeChunkModules: SyncHook; - shouldRecord: SyncBailHook; - - reviveModules: SyncHook; - optimizeModuleOrder: SyncHook; - advancedOptimizeModuleOrder: SyncHook; - beforeModuleIds: SyncHook; - moduleIds: SyncHook; - optimizeModuleIds: SyncHook; - afterOptimizeModuleIds: SyncHook; - - reviveChunks: SyncHook; - optimizeChunkOrder: SyncHook; - beforeChunkIds: SyncHook; - optimizeChunkIds: SyncHook; - afterOptimizeChunkIds: SyncHook; - - recordModules: SyncHook; - recordChunks: SyncHook; - - beforeHash: SyncHook; - afterHash: SyncHook; - - recordHash: SyncHook; - - record: SyncHook; - - beforeModuleAssets: SyncHook; - shouldGenerateChunkAssets: SyncBailHook; - beforeChunkAssets: SyncHook; - additionalChunkAssets: SyncHook; - - records: SyncHook; - - additionalAssets: AsyncSeriesHook; - optimizeChunkAssets: AsyncSeriesHook; - afterOptimizeChunkAssets: SyncHook; - optimizeAssets: AsyncSeriesHook; - afterOptimizeAssets: SyncHook; - - needAdditionalSeal: SyncBailHook; - afterSeal: AsyncSeriesHook; - - chunkHash: SyncHook; - moduleAsset: SyncHook; - chunkAsset: SyncHook; - - assetPath: SyncWaterfallHook; - - needAdditionalPass: SyncBailHook; - childCompiler: SyncHook; - - normalModuleLoader: SyncHook; - - optimizeExtractedChunksBasic: SyncBailHook; - optimizeExtractedChunks: SyncBailHook; - optimizeExtractedChunksAdvanced: SyncBailHook; - afterOptimizeExtractedChunks: SyncHook; - } - - interface CompilationModule { - module: any; - issuer: boolean; - build: boolean; - dependencies: boolean; - } - - class MainTemplate extends Tapable {} - class ChunkTemplate extends Tapable {} - class HotUpdateChunkTemplate extends Tapable {} - class RuntimeTemplate {} - - interface ModuleTemplateHooks { - content: SyncWaterfallHook; - module: SyncWaterfallHook; - render: SyncWaterfallHook; - package: SyncWaterfallHook; - hash: SyncHook; - } - - class ModuleTemplate extends Tapable { - hooks: ModuleTemplateHooks; - } - - class Compilation extends Tapable { - hooks: CompilationHooks; - compiler: Compiler; - - resolverFactory: any; - inputFileSystem: any; - requestShortener: any; - - outputOptions: any; - bail: any; - profile: any; - performance: any; - - mainTemplate: MainTemplate; - chunkTemplate: ChunkTemplate; - hotUpdateChunkTemplate: HotUpdateChunkTemplate; - runtimeTemplate: RuntimeTemplate; - moduleTemplates: { - javascript: ModuleTemplate; - webassembly: ModuleTemplate; - }; - - entries: any[]; - _preparedEntrypoints: any[]; - entrypoints: Map; - chunks: any[]; - chunkGroups: any[]; - namedChunkGroups: Map; - namedChunks: Map; - modules: any[]; - _modules: Map; - cache: any; - records: any; - nextFreeModuleIndex: any; - nextFreeModuleIndex2: any; - additionalChunkAssets: any[]; - assets: any; - errors: any[]; - warnings: any[]; - children: any[]; - dependencyFactories: Map; - dependencyTemplates: Map; - childrenCounters: any; - usedChunkIds: any; - usedModuleIds: any; - getStats(): Stats; - addModule(module: CompilationModule, cacheGroup: any): any; - // getModule(module) - // findModule(identifier) - // waitForBuildingFinished(module, callback) - // buildModule(module, optional, origin, dependencies, thisCallback) - // processModuleDependencies(module, callback) - // addModuleDependencies(module, dependencies, bail, cacheGroup, recursive, callback) - // tslint:disable-next-line:ban-types - addEntry(context: any, entry: any, name: any, callback: Function): void; - // prefetch(context, dependency, callback) - // rebuildModule(module, thisCallback) - // finish() - // unseal() - // seal(callback) - // sortModules(modules) - // reportDependencyErrorsAndWarnings(module, blocks) - // addChunkInGroup(name, module, loc, request) - // addChunk(name) - // assignIndex(module) - // assignDepth(module) - // processDependenciesBlocksForChunkGroups(inputChunkGroups) - // removeReasonsOfDependencyBlock(module, block) - // patchChunksAfterReasonRemoval(module, chunk) - // removeChunkFromDependencies(block, chunk) - // applyModuleIds() - // applyChunkIds() - // sortItemsWithModuleIds() - // sortItemsWithChunkIds() - // summarizeDependencies() - // createHash() - // modifyHash(update) - // createModuleAssets() - // createChunkAssets() - getPath(filename: string, data: {hash?: any, chunk?: any, filename?: string, basename?: string, query?: any}): string; - // createChildCompiler(name, outputOptions, plugins) - // checkConstraints() - - /** - * @deprecated Compilation.applyPlugins is deprecated. Use new API on `.hooks` instead - */ - applyPlugins(name: string, ...args: any[]): void; - } - // tslint:disable-next-line:interface-name interface ICompiler { run(handler: ICompiler.Handler): void; @@ -943,38 +985,11 @@ declare namespace webpack { invalidate(): void; } - interface CompilerHooks { - shouldEmit: SyncBailHook; - done: AsyncSeriesHook; - additionalPass: AsyncSeriesHook; - beforeRun: AsyncSeriesHook; - run: AsyncSeriesHook; - emit: AsyncSeriesHook; - afterEmit: AsyncSeriesHook; - thisCompilation: SyncHook; - compilation: SyncHook; - normalModuleFactory: SyncHook; - contextModuleFactory: SyncHook; - beforeCompile: AsyncSeriesHook; - compile: SyncHook; - make: AsyncParallelHook; - afterCompile: AsyncSeriesHook; - watchRun: AsyncSeriesHook; - failed: SyncHook; - invalid: SyncHook; - watchClose: SyncHook; - environment: SyncHook; - afterEnvironment: SyncHook; - afterPlugins: SyncHook; - afterResolvers: SyncHook; - entryOption: SyncBailHook; - } - class Compiler extends Tapable implements ICompiler { constructor(); - hooks: CompilerHooks; - _pluginCompat: SyncBailHook; + hooks: compilation.CompilerHooks; + _pluginCompat: SyncBailHook; name: string; options: Configuration; diff --git a/types/webpack/webpack-tests.ts b/types/webpack/webpack-tests.ts index a49541f796..d6bd908357 100644 --- a/types/webpack/webpack-tests.ts +++ b/types/webpack/webpack-tests.ts @@ -582,14 +582,14 @@ configuration = { plugin = new webpack.SplitChunksPlugin({ chunks: "async", minChunks: 2 }); -class SingleEntryDependency extends webpack.Dependency {} -class MultiEntryDependency extends webpack.Dependency {} +class SingleEntryDependency extends webpack.compilation.Dependency {} +class MultiEntryDependency extends webpack.compilation.Dependency {} class MultiModuleFactory extends Tapable {} class MultiEntryPlugin extends webpack.Plugin { apply(compiler: webpack.Compiler) { compiler.hooks.compilation.tap( "MultiEntryPlugin", - (compilation, { normalModuleFactor }) => { + (compilation, { normalModuleFactory }) => { compilation.dependencyFactories.set(MultiEntryDependency, new MultiModuleFactory()); } ); @@ -617,7 +617,7 @@ class IgnorePlugin extends webpack.Plugin { } } -class DllEntryDependency extends webpack.Dependency {} +class DllEntryDependency extends webpack.compilation.Dependency {} class DllModuleFactory extends Tapable {} class DllEntryPlugin extends webpack.Plugin { apply(compiler: webpack.Compiler) {