On this page

new Compiler(context, options?): Compiler
Attributes
context:<string>
the compilation path
Returns:<Compiler>
  • cache {CacheClass}
  • compilerPath <string>
  • context <string>
  • contextTimestamps {Map<string, "ignore"|EntryTypesIndex|OnlySafeTimeEntry|ExistenceOnlyTimeEntryTypesIndex|null>}
  • fileTimestamps {Map<string, "ignore"|EntryTypesIndex|OnlySafeTimeEntry|ExistenceOnlyTimeEntryTypesIndex|null>}
  • fsStartTime <number>
  • hooks {Readonly}
  • idle <boolean>
  • immutablePaths {Set<string|RegExp>}
  • infrastructureLogger <object>
  • inputFileSystem <InputFileSystem> | <null>
  • intermediateFileSystem <null>
  • managedPaths {Set<string|RegExp>}
  • modifiedFiles {ReadonlySet}
  • moduleMemCaches {Map<Module, ModuleMemCachesItem>}
  • name <string>
  • options <WebpackOptionsNormalized>
  • outputFileSystem <OutputFileSystem> | <null>
  • outputPath <string>
  • parentCompilation <Compilation>
  • platform {Readonly}
  • records {Records}
  • recordsInputPath <string> | <null>
  • recordsOutputPath <string> | <null>
  • removedFiles {ReadonlySet}
  • requestShortener {RequestShortener}
  • resolverFactory {ResolverFactory}
  • root <Compiler>
  • running <boolean>
  • unmanagedPaths {Set<string|RegExp>}
  • watchFileSystem <null>
  • watching <Watching>
  • watchMode <boolean>
  • webpack {exports}
  • close(callback): void
    Attributes
    callback:<object>
    signals when the compiler closes
    Returns:
    {void}

    compile(callback): void
    • callback {CallbackWebpackFunction_2<Compilation, void>} signals when the compilation finishes
    • Returns: {void}

    createChildCompiler(compilation, compilerName, compilerIndex, outputOptions?, plugins?): Compiler
    Attributes
    compilation:<Compilation>
    the compilation
    compilerName:<string>
    the compiler's name
    compilerIndex:<number>
    the compiler's index
    outputOptions:
    {Partial } the output options
    the plugins to apply
    Returns:<Compiler>
    a child compiler

    createCompilation(params): void
    • params {CompilationParams} the compilation parameters
    • Returns: <Compilation> compilation

    createContextModuleFactory(): ContextModuleFactory
    Returns:
    {ContextModuleFactory}

    createNormalModuleFactory(): NormalModuleFactory
    Returns:
    {NormalModuleFactory}

    emitAssets(compilation, callback): void
    Attributes
    compilation:<Compilation>
    the compilation
    callback:<object>
    signals when the assets are emitted
    Returns:
    {void}

    emitRecords(callback): void
    Attributes
    callback:<object>
    signals when the call finishes
    Returns:
    {void}

    getCache(name): CacheFacade
    Attributes
    cache name
    Returns:
    {CacheFacade} the cache facade instance

    getInfrastructureLogger(name): WebpackLogger
    Attributes
    name of the logger, or function called once to get the logger name
    Returns:
    {WebpackLogger} a logger with that name

    isChild(): boolean
    Returns:<boolean>

    Compilation(params): void
    • params {CompilationParams} the compilation parameters
    • Returns: <Compilation> the created compilation

    CompilationParams(): object
    Returns:<object>

    purgeInputFileSystem(): void
    Returns:
    {void}

    readRecords(callback): void
    Attributes
    callback:<object>
    signals when the call finishes
    Returns:
    {void}

    run(callback): void
    • callback {CallbackWebpackFunction_2<Stats, void>} signals when the call finishes
    • Returns: {void}

    runAsChild(callback): void
    Attributes
    callback:<object>
    signals when the call finishes
    Returns:
    {void}

    validate(schema, value, options?, check?): void
    Attributes
    schema:<object>
    schema
    value:
    {T} value
    options:
    {ValidationErrorConfiguration} options
    check:<object>
    options
    Returns:
    {void}

    Schema validation function with optional pre-compiled check


    watch(watchOptions, handler): void
    • watchOptions {WatchOptions} the watcher's options
    • handler {CallbackWebpackFunction_2<Stats, void>} signals when the call finishes
    • Returns: <Watching> | <undefined> a compiler watcher