new Compilation(compiler, params): voidcompiler{Compiler} the compiler which created the compilationparams{CompilationParams} the compilation parameters- Returns: {Compilation}
Creates an instance of Compilation.
Attributes
additionalChunkAssets:
<string[]>addModuleQueue:
{AsyncQueue<Module, string, Module>}
assets:
{CompilationAssets}
assetsInfo:
{Map<string, AssetInfo>}
asyncEntrypoints:
{Entrypoint[]}
bail:
<boolean>buildDependencies:
{LazySet
}
buildQueue:
{AsyncQueue<Module, Module, Module>}
buildTimeExecutedModules:
{WeakSet
}
builtModules:
{WeakSet
}
children:
{Compilation[]}
childrenCounters:
{Record<string, number>}
chunkGraph:
{ChunkGraph}
chunkGroups:
{ChunkGroup[]}
chunks:
{Set
}
chunkTemplate:
{ChunkTemplate}
codeGeneratedModules:
{WeakSet
}
codeGenerationResults:
{CodeGenerationResults}
comparedForEmitAssets:
{Set
}
compilationDependencies:
<object>compiler:
{Compiler}
compilerPath:
<string>contextDependencies:
{LazySet
}
creatingModuleDuringBuild:
{WeakMap<Module, Set
>} Modules in value are building during the build of Module in key.
Means value blocking key from finishing.
Needed to detect build cycles.
dependencyFactories:
{Map<DependencyConstructor, ModuleFactory>}
dependencyTemplates:
{DependencyTemplates}
emittedAssets:
{Set
}
endTime:
<number>entries:
{Map<string, EntryData>}
entrypoints:
{Map<string, Entrypoint>}
errors:
<Error[]>factorizeQueue:
{AsyncQueue<FactorizeModuleOptions, string, Module|ModuleFactoryResult>}
fileDependencies:
{LazySet
}
fileSystemInfo:
{FileSystemInfo}
fullHash:
<string>globalEntry:
{EntryData}
hash:
<string>hooks:
{Readonly
inputFileSystem:
{InputFileSystem}
logger:
{WebpackLogger}
logging:
{Map<string, LogEntry[]>}
mainTemplate:
{MainTemplate}
missingDependencies:
{LazySet
}
moduleGraph:
{ModuleGraph}
moduleMemCaches:
{Map<Module, WeakTupleMap<any[], any>>}
moduleMemCaches2:
{Map<Module, WeakTupleMap<any[], any>>}
modules:
{Set
}
moduleTemplates:
{ModuleTemplates}
name:
<string>namedChunkGroups:
{Map<string, ChunkGroup>}
namedChunks:
{Map<string, Chunk>}
needAdditionalPass:
<boolean>options:
{WebpackOptionsNormalizedWithDefaults}
outputOptions:
{OutputNormalizedWithDefaults}
params:
{CompilationParams}
processDependenciesQueue:
{AsyncQueue<Module, Module, Module>}
profile:
<boolean>rebuildQueue:
{AsyncQueue<Module, Module, Module>}
records:
{Records}
requestShortener:
{RequestShortener}
resolverFactory:
{ResolverFactory}
runtimeTemplate:
{RuntimeTemplate}
startTime:
<number>usedChunkIds:
{Set
}
usedModuleIds:
{Set
}
valueCacheVersions:
{Map<string, ValueCacheVersion>}
warnings:
<Error[]>PROCESS_ASSETS_STAGE_ADDITIONAL:
<number>Add additional assets to the compilation.
PROCESS_ASSETS_STAGE_ADDITIONS:
<number>Add additional sections to existing assets, like a banner or initialization code.
PROCESS_ASSETS_STAGE_ANALYSE:
<number>Analyse existing assets.
PROCESS_ASSETS_STAGE_DERIVED:
<number>Derive new assets from existing assets.
Existing assets should not be treated as complete.
PROCESS_ASSETS_STAGE_DEV_TOOLING:
<number>Add development tooling to assets, e. g. by extracting a SourceMap.
PROCESS_ASSETS_STAGE_OPTIMIZE:
<number>Optimize existing assets in a general way.
PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY:
<number>Optimize the compatibility of existing assets, e. g. add polyfills or vendor-prefixes.
PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT:
<number>Optimize 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.
PROCESS_ASSETS_STAGE_OPTIMIZE_HASH:
<number>Optimize the hashes of the assets, e. g. by generating real hashes of the asset content.
PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE:
<number>Optimize 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.
PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE:
<number>Optimize the size of existing assets, e. g. by minimizing or omitting whitespace.
PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER:
<number>Optimize the transfer of existing assets, e. g. by preparing a compressed (gzip) file as separate asset.
PROCESS_ASSETS_STAGE_PRE_PROCESS:
<number>Basic preprocessing of assets.
PROCESS_ASSETS_STAGE_REPORT:
<number>Creating assets for reporting purposes.
PROCESS_ASSETS_STAGE_SUMMARIZE:
<number>Summarize the list of existing assets
e. g. creating an assets manifest of Service Workers.
webpack.Compilation.addAsyncEntrypoint(options, module, loc, request): voidoptions{EntryOptions} options for the entrypointmodule{Module} the module the references the chunk grouploc{DependencyLocation} the location from with the chunk group is referenced (inside of module)request<string>the request from which the chunk group is referenced- Returns: {Entrypoint} the new or existing entrypoint
webpack.Compilation.addChunk(name?): ChunkAttributes
name:
<string>optional chunk name to be provided
Returns:
{Chunk} create a chunk (invoked during seal event)
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.
webpack.Compilation.addChunkInGroup(groupOptions, module?, loc?, request?): ChunkGroupAttributes
groupOptions:
<string>options for the chunk group
module:
{Module} the module the references the chunk group
loc:
{SyntheticDependencyLocation|RealDependencyLocation} the location from with the chunk group is referenced (inside of module)
request:
<string>the request from which the chunk group is referenced
Returns:
{ChunkGroup} the new or existing chunk group
If module is passed, loc and request must also be passed.
webpack.Compilation.addEntry(context, entry, optionsOrName, callback): voidAttributes
Returns:
{void} returns
webpack.Compilation.addInclude(context, dependency, options, callback): voidAttributes
Returns:
{void} returns
webpack.Compilation.addModule(module, callback): voidmodule{Module} module to be added that was createdcallback<object>returns the module in the compilation, it could be the passed one (if new), or an already existing in the compilation- Returns: {void}
webpack.Compilation.addModuleChain(context, dependency, callback): voidAttributes
Returns:
{void} will throw if dependency instance is not a valid Dependency
webpack.Compilation.addModuleTree(__namedParameters, callback): voidAttributes
Returns:
{void} will throw if dependency instance is not a valid Dependency
webpack.Compilation.addRuntimeModule(chunk, module, chunkGraph?): voidchunk{Chunk} target chunkmodule{RuntimeModule} runtime modulechunkGraph{ChunkGraph} the chunk graph- Returns: {void}
webpack.Compilation.assignDepth(module): voidmodule{Module} module to assign depth- Returns: {void}
webpack.Compilation.assignDepths(modules): voidmodules{Set} module to assign depth - Returns: {void}
webpack.Compilation.assignRuntimeIds(): voidReturns:
{void}
webpack.Compilation.buildModule(module, callback): voidmodule{Module} module to be builtcallback<object>the callback- Returns: {void}
Schedules a build of the module object
webpack.Compilation.checkConstraints(): voidReturns:
{void}
webpack.Compilation.clearAssets(): voidReturns:
{void}
webpack.Compilation.codeGeneration(callback): voidAttributes
callback:
<object>callback
Returns:
{void}
webpack.Compilation.createChildCompiler(name, outputOptions?, plugins?): CompilerAttributes
Returns:
{Compiler} creates a child Compiler instance
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
webpack.Compilation.createChunkAssets(callback): voidAttributes
callback:
<object>signals when the call finishes
Returns:
{void}
webpack.Compilation.createHash(): CodeGenerationJob[]Returns:
{CodeGenerationJob[]}
webpack.Compilation.createModuleAssets(): voidReturns:
{void}
webpack.Compilation.createModuleHashes(): voidReturns:
{void}
webpack.Compilation.createStatsFactory(options): voidoptions{NormalizedStatsOptions} options- Returns: {StatsFactory} the stats factory
webpack.Compilation.createStatsOptions(optionsOrPreset?, context?): NormalizedStatsOptionsAttributes
Returns:
{NormalizedStatsOptions} normalized options
webpack.Compilation.createStatsPrinter(options): voidoptions{NormalizedStatsOptions} options- Returns: {StatsPrinter} the stats printer
webpack.Compilation.deleteAsset(file): voidAttributes
file:
<string>file name
Returns:
{void}
webpack.Compilation.emitAsset(file, source, assetInfo?): voidAttributes
Returns:
{void}
webpack.Compilation.executeModule(module, options, callback): voidmodule{Module} the moduleoptions{ExecuteModuleOptions} optionscallback<object>callback- Returns: {void}
webpack.Compilation.factorizeModule(options, callback): voidAttributes
Returns:
{void}
Attributes
Returns:
{void}
webpack.Compilation.findModule(identifier): ModuleAttributes
identifier:
<string>identifier (usually path) for module
Returns:
{Module} attempt to search for module and return it, else undefined
Attempts to search for a module by its identifier
webpack.Compilation.finish(callback): voidAttributes
callback:
<object>callback
Returns:
{void}
webpack.Compilation.getAsset(name): Readonly<Asset>Attributes
name:
<string>the name of the asset
Returns:
{Readonly
} the asset or undefined when not found
webpack.Compilation.getAssetPath(filename, data): voidfilename{TemplatePath} used to get asset path with hashdata{PathData} context data- Returns:
<string>interpolated path
webpack.Compilation.getAssetPathWithInfo(filename, data): voidfilename{TemplatePath} used to get asset path with hashdata{PathData} context data- Returns: {InterpolatedPathAndAssetInfo} interpolated path and asset info
webpack.Compilation.getAssets(): Readonly<Asset>[]Returns:
{Readonly
[]}
webpack.Compilation.getCache(name): CacheFacadeAttributes
name:
<string>cache name
Returns:
{CacheFacade} the cache facade instance
webpack.Compilation.getDependencyReferencedExports(dependency, runtime): voiddependency{Dependency} the dependencyruntime{RuntimeSpec} the runtime- Returns:
<string[]>referenced exports
webpack.Compilation.getErrors(): Error[]Returns:
<Error[]>webpack.Compilation.getLogger(name): WebpackLoggerAttributes
Returns:
{WebpackLogger} a logger with that name
webpack.Compilation.getModule(module): voidmodule{Module} the module provided- Returns: {Module} the module requested
Fetches a module from a compilation by its identifier
webpack.Compilation.getPath(filename, data?): voidfilename{TemplatePath} used to get asset path with hashdata{PathData} context data- Returns:
<string>interpolated path
webpack.Compilation.getPathWithInfo(filename, data?): voidfilename{TemplatePath} used to get asset path with hashdata{PathData} context data- Returns: {InterpolatedPathAndAssetInfo} interpolated path and asset info
webpack.Compilation.getRenderManifest(options): voidoptions{RenderManifestOptions} options object- Returns: {RenderManifestEntry[]} manifest entries
webpack.Compilation.getStats(): StatsReturns:
{Stats}
webpack.Compilation.getWarnings(): Error[]Returns:
<Error[]>webpack.Compilation.handleModuleCreation(__namedParameters, callback): void__namedParameters{HandleModuleCreationOptions}callback<object>callback- Returns: {void}
webpack.Compilation.patchChunksAfterReasonRemoval(module, chunk): voidmodule{Module} module to patch tiechunk{Chunk} chunk to patch tie- Returns: {void}
webpack.Compilation.processModuleDependencies(module, callback): voidmodule{Module} to be processed for depscallback<object>callback to be triggered- Returns: {void}
webpack.Compilation.processModuleDependenciesNonRecursive(module): voidmodule{Module} to be processed for deps- Returns: {void}
webpack.Compilation.processRuntimeRequirements(__namedParameters?): voidAttributes
__namedParameters:
<object>options
Returns:
{void}
webpack.Compilation.rebuildModule(module, callback): voidmodule{Module} module to be rebuiltcallback<object>callback when module finishes rebuilding- Returns: {void}
webpack.Compilation.removeChunkFromDependencies(block, chunk): voidblock{DependenciesBlock} block tie for Chunkchunk{Chunk} chunk to remove from dep- Returns: {void}
webpack.Compilation.removeReasonsOfDependencyBlock(module, block): voidmodule{Module} module relationship for removalblock{DependenciesBlockLike} dependencies block- Returns: {void}
webpack.Compilation.renameAsset(file, newFile): voidAttributes
Returns:
{void}
webpack.Compilation.reportDependencyErrorsAndWarnings(module, blocks): voidmodule{Module} module to report fromblocks{DependenciesBlock[]} blocks to report from- Returns:
<boolean>true, when it has warnings or errors
webpack.Compilation.seal(callback): voidAttributes
callback:
<object>signals when the call finishes
Returns:
{void}
webpack.Compilation.sortItemsWithChunkIds(): voidReturns:
{void}
webpack.Compilation.summarizeDependencies(): voidReturns:
{void}
webpack.Compilation.unseal(): voidReturns:
{void}
webpack.Compilation.updateAsset(file, newSourceOrFunction, assetInfoUpdateOrFunction?): voidAttributes
Returns:
{void}