On this page

new Compiler(context, options?): Compiler
Attributes
Returns:<Compiler>

Creates an instance of 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>
    Returns:
    {void}

    Processes the provided error callback.


    compile(callback): void
    • callback {CallbackWebpackFunction_2<Compilation, void>}
    • Returns: {void}

    Processes the provided compilation.


    createChildCompiler(compilation, compilerName, compilerIndex, outputOptions?, plugins?): Compiler
    Attributes
    compilation:<Compilation>
    compilerName:<string>
    compilerIndex:<number>
    outputOptions:
    {Partial }
    Returns:<Compiler>

    Creates a child compiler.


    createCompilation(params): void

    Creates a compilation.


    createContextModuleFactory(): ContextModuleFactory
    Returns:
    {ContextModuleFactory}

    createNormalModuleFactory(): NormalModuleFactory
    Returns:
    {NormalModuleFactory}

    emitAssets(compilation, callback): void
    Attributes
    compilation:<Compilation>
    callback:<object>
    Returns:
    {void}

    Processes the provided compilation.


    emitRecords(callback): void
    Attributes
    callback:<object>
    Returns:
    {void}

    Processes the provided error callback.


    getCache(name): CacheFacade
    Attributes
    Returns:
    {CacheFacade}

    Returns the cache facade instance.


    getInfrastructureLogger(name): WebpackLogger
    Attributes
    Returns:
    {WebpackLogger}

    Gets infrastructure logger.


    isChild(): boolean
    Returns:<boolean>

    Compilation(params): void

    Returns the created compilation.


    CompilationParams(): object
    Returns:<object>

    purgeInputFileSystem(): void
    Returns:
    {void}

    readRecords(callback): void
    Attributes
    callback:<object>
    Returns:
    {void}

    Processes the provided error callback.


    run(callback): void
    • callback {CallbackWebpackFunction_2<Stats, void>}
    • Returns: {void}

    Processes the provided stat.


    runAsChild(callback): void
    Attributes
    callback:<object>
    Returns:
    {void}

    Processes the provided run as child callback.


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

    Schema validation function with optional pre-compiled check


    watch(watchOptions, handler): void
    • watchOptions {WatchOptions}
    • handler {CallbackWebpackFunction_2<Stats, void>}
    • Returns: <Watching> | <undefined>

    Returns a compiler watcher.