new Compilation(compiler, params): Compilation
Creates an instance of Compilation.
Source Code: lib/Compilation.js#L1320string[]AsyncQueue<Module, string, Module>CompilationAssetsEntrypoint[]booleanAsyncQueue<Module, Module, Module>Compilation[]ChunkGraphChunkGroup[]ChunkTemplateObjectcompilation.compilationDependencies.add(item): LazySet<string>
CompilerstringModules in value are building during the build of Module in key. Means value blocking key from finishing. Needed to detect build cycles.
Source Code: lib/Compilation.js#L1340DependencyTemplatesnumberMap<string, Entrypoint>Error[]FileSystemInfostringEntryDatastringObjectSyncHook<[Dependency, EntryOptions]>FakeHook<Pick<AsyncSeriesHook<[]>, "name" | "tap" | "tapAsync" | "tapPromise">>SyncHook<[Chunk, Set<string>, RuntimeRequirementsContext]>SyncHook<[Module, Set<string>, RuntimeRequirementsContext]>SyncHook<[Chunk, Set<string>, RuntimeRequirementsContext]>The afterChunks hook is called directly after the chunks and module graph have
been created and before the chunks and modules have been optimized. This hook is useful to
inspect, analyze, and/or modify the chunk graph.
SyncHook<[]>SyncHook<[]>SyncHook<[]>SyncHook<[CompilationAssets]>SyncHook<[Iterable<Chunk>, ChunkGroup[]]>SyncHook<[CompilationAssets]>SyncHook<[]>AsyncSeriesHook<[]>SyncHook<[]>SyncHook<[]>SyncHook<[]>SyncHook<[]>SyncHook<[]>SyncHook<[]>SyncHook<[]>SyncHook<[Module]>SyncHook<[Chunk, Hash, ChunkHashContext]>SyncHook<[Chunk]>SyncWaterfallHook<[(string[] | ReferencedExport)[], Dependency, RuntimeSpec], (string[] | ReferencedExport)[]>SyncHook<[ExecuteModuleArgument, ExecuteModuleContext]>SyncHook<[Dependency, EntryOptions, Error]>SyncHook<[Module, WebpackError]>AsyncSeriesHook<[Module]>SyncHook<[Hash]>SyncHook<[]>AsyncSeriesHook<[CompilationAssets], ProcessAssetsAdditionalOptions>SyncBailHook<[Iterable<Chunk>, ChunkGroup[]], boolean | void>AsyncParallelHook<[ExecuteModuleArgument, ExecuteModuleContext]>AsyncSeriesHook<[CompilationAssets]>AsyncSeriesHook<[CompilationAssets], ProcessAssetsAdditionalOptions>SyncHook<[Module]>SyncHook<[Compilation, Records]>SyncHook<[Records]>SyncWaterfallHook<[RenderManifestEntry[], RenderManifestOptions], RenderManifestEntry[]>SyncHook<[RuntimeModule, Chunk]>HookMap<SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>>HookMap<SyncBailHook<[Module, Set<string>, RuntimeRequirementsContext], void>>HookMap<SyncBailHook<[Chunk, Set<string>, RuntimeRequirementsContext], void>>SyncHook<[]>SyncHook<[StatsFactory, NormalizedStatsOptions]>SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>HookMap<SyncHook<[Partial<NormalizedStatsOptions>, CreateStatsOptionsContext]>>SyncHook<[StatsPrinter, NormalizedStatsOptions]>SyncHook<[Module]>SyncHook<[Dependency, EntryOptions, Module]>SyncHook<[Module]>SyncHook<[]>SyncHook<[AnyLoaderContext, NormalModule]>Gets normal module loader.
Source Code: lib/Compilation.js#L1172InputFileSystemWebpackLoggerMainTemplateModuleGraphMap<Module, WeakTupleMap<any[], any>>Map<Module, WeakTupleMap<any[], any>>ModuleTemplatesstringMap<string, ChunkGroup>booleanCompilationParamsAsyncQueue<Module, Module, Module>booleanAsyncQueue<Module, Module, Module>RequestShortenerResolverFactoryRuntimeTemplatenumberMap<string, ValueCacheVersion>Error[]numberAdd additional assets to the compilation.
numberAdd additional sections to existing assets, like a banner or initialization code.
numberAnalyse existing assets.
numberDerive new assets from existing assets. Existing assets should not be treated as complete.
numberAdd development tooling to assets, e. g. by extracting a SourceMap.
numberOptimize existing assets in a general way.
numberOptimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
numberOptimize the count of existing assets, e. g. by merging them. Only assets of the same type should be merged. For assets of different types see PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE.
numberOptimize the hashes of the assets, e. g. by generating real hashes of the asset content.
numberOptimize the count of existing assets, e. g. by inlining assets of into other assets. Only assets of different types should be inlined. For assets of the same type see PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT.
numberOptimize the size of existing assets, e. g. by minimizing or omitting whitespace.
numberOptimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
numberBasic preprocessing of assets.
numberCreating assets for reporting purposes.
numberSummarize the list of existing assets e. g. creating an assets manifest of Service Workers.
compilation.addAsyncEntrypoint(options, module, loc, request): Entrypoint
Adds the provided async entrypoint to this chunk group.
compilation.addChunk(name?): Chunk
This method first looks to see if a name is provided for a new chunk, and first looks to see if any named chunks already exist and reuse that chunk instead.
compilation.addChunkInGroup(groupOptions, module?, loc?, request?): ChunkGroup
If module is passed, loc and request must also be passed.
compilation.addEntry(context, entry, optionsOrName, callback): void
stringDependencystring | EntryOptions(err?: WebpackError | null, result?: Module | null) => voidAdds the provided string to the compilation.
compilation.addInclude(context, dependency, options, callback): void
stringDependencyEntryOptions(err?: WebpackError | null, result?: Module | null) => voidAdds the provided string to the compilation.
compilation.addModule(module, callback): void
Adds the provided module to the compilation.
compilation.addModuleChain(context, dependency, callback): void
stringDependency(err?: WebpackError | null, result?: Module | null) => voidAdds the provided string to the compilation.
compilation.addModuleTree(__namedParameters, callback): void
ObjectstringPartial<ModuleFactoryCreateDataContextInfo>Dependency(err?: WebpackError | null, result?: Module | null) => voidAdds the provided object to the compilation.
compilation.addRuntimeModule(chunk, module, chunkGraph?): void
Adds runtime module.
compilation.assignDepth(module): void
ModuleProcesses the provided module.
compilation.assignDepths(modules): void
Assigns depth values to the provided modules.
compilation.assignRuntimeIds(): void
compilation.buildModule(module, callback): void
Schedules a build of the module object
compilation.checkConstraints(): void
compilation.clearAssets(): void
compilation.codeGeneration(callback): void
(err?: WebpackError | null) => voidGenerates code and runtime requirements for this module.
compilation.createChildCompiler(name, outputOptions?, plugins?): Compiler
This function allows you to run another instance of webpack inside of webpack however as a child with different settings and configurations (if desired) applied. It copies all hooks, plugins from parent (or top level compiler) and creates a child Compilation
compilation.createChunkAssets(callback): void
(err?: WebpackError | null) => voidCreates a chunk assets.
compilation.createHash(): CodeGenerationJob[]
CodeGenerationJob[]compilation.createModuleAssets(): void
compilation.createModuleHashes(): void
compilation.createStatsFactory(options): StatsFactory
NormalizedStatsOptionsStatsFactoryCreates a stats factory.
compilation.createStatsOptions(optionsOrPreset?, context?): NormalizedStatsOptions
string | boolean | StatsOptionsCreateStatsOptionsContextNormalizedStatsOptionsCreates a stats options.
compilation.createStatsPrinter(options): StatsPrinter
NormalizedStatsOptionsStatsPrinterCreates a stats printer.
compilation.deleteAsset(file): void
stringProcesses the provided file.
compilation.emitAsset(file, source, assetInfo?): void
Processes the provided file.
compilation.executeModule(module, options, callback): void
ModuleExecuteModuleOptions(err?: WebpackError | null, result?: ExecuteModuleResult | null) => voidProcesses the provided module.
compilation.factorizeModule(options, callback): void
FactorizeModuleOptions & { factoryResult?: false }(err?: WebpackError | null, result?: Module | null) => voidProcesses the provided module callback.
compilation.factorizeModule(options, callback): void
FactorizeModuleOptions & { factoryResult: true }(err?: WebpackError | null, result?: ModuleFactoryResult | null) => voidProcesses the provided module factory result callback.
compilation.findModule(identifier): Module | undefined
Attempts to search for a module by its identifier
compilation.finish(callback): void
(err?: WebpackError | null) => voidProcesses the provided callback.
compilation.getAsset(name): Readonly<Asset> | undefined
Returns the asset or undefined when not found.
compilation.getAssetPath(filename, data): string
Returns interpolated path.
compilation.getAssetPathWithInfo(filename, data): InterpolatedPathAndAssetInfo
Gets asset path with info.
compilation.getAssets(): Readonly<Asset>[]
Readonly<Asset>[]compilation.getCache(name): CacheFacade
stringCacheFacadeReturns the cache facade instance.
compilation.getDependencyReferencedExports(dependency, runtime): (string[] | ReferencedExport)[]
Gets dependency referenced exports.
compilation.getErrors(): Error[]
Error[]compilation.getLogger(name): WebpackLogger
WebpackLoggerReturns a logger with that name.
compilation.getModule(module): Module
Fetches a module from a compilation by its identifier
compilation.getPath(filename, data?): string
Returns interpolated path.
compilation.getPathWithInfo(filename, data?): InterpolatedPathAndAssetInfo
Gets path with info.
compilation.getRenderManifest(options): RenderManifestEntry[]
RenderManifestOptionsRenderManifestEntry[]Gets render manifest.
compilation.getStats(): Stats
Statscompilation.getWarnings(): Error[]
Error[]compilation.handleModuleCreation(__namedParameters, callback): void
HandleModuleCreationOptions(err?: WebpackError | null, result?: Module | null) => voidHandle module creation.
compilation.patchChunksAfterReasonRemoval(module, chunk): void
Patch chunks after reason removal.
compilation.processModuleDependencies(module, callback): void
Process module dependencies.
compilation.processModuleDependenciesNonRecursive(module): void
ModuleProcess module dependencies non recursive.
compilation.processRuntimeRequirements(__namedParameters?): void
Process runtime requirements.
compilation.rebuildModule(module, callback): void
Processes the provided module.
compilation.removeChunkFromDependencies(block, chunk): void
DependenciesBlockChunkRemoves chunk from dependencies.
compilation.removeReasonsOfDependencyBlock(module, block): void
ModuleDependenciesBlockLikeRemoves reasons of dependency block.
compilation.renameAsset(file, newFile): void
Processes the provided file.
compilation.reportDependencyErrorsAndWarnings(module, blocks): boolean
Report dependency errors and warnings.
compilation.seal(callback): void
(err?: WebpackError | null) => voidProcesses the provided callback.
compilation.sortItemsWithChunkIds(): void
compilation.summarizeDependencies(): void
compilation.unseal(): void
compilation.updateAsset(file, newSourceOrFunction, assetInfoUpdateOrFunction?): void
Updates asset using the provided file.