On this page

webpack is configured with an options object, usually exported from a webpack.config.js file. Every build validates that object against the options schema (schemas/WebpackOptions.json), so unknown or malformed options fail with a descriptive error. This page is generated from that schema and lists every supported option; named types link to their full definitions in the API documentation.

Set the value of require.amd and define.amd. Or disable AMD support.

Type:false | object
export default {
  amd: false,
};

Report the first error as a hard error instead of tolerating it.

Type:boolean
export default {
  bail: true,
};

Cache generated modules and chunks to improve performance for multiple incremental builds.

Type:true | false | MemoryCacheOptions | FileCacheOptions
export default {
  cache: { type: "filesystem" },
};

Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost.

Type:boolean
export default {
  cache: {
    allowCollectingMemory: true,
  },
};

Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack').

Type:object
export default {
  cache: {
    buildDependencies: {},
  },
};

Base directory for the cache (defaults to node_modules/.cache/webpack).

Type:string
export default {
  cache: {
    cacheDirectory: '...',
  },
};

Locations for the cache (defaults to cacheDirectory / name).

Type:string
export default {
  cache: {
    cacheLocation: '...',
  },
};

Compression type used for the cache files.

Type:false | "gzip" | "brotli"
export default {
  cache: {
    compression: "gzip",
  },
};

Algorithm used for generation the hash (see node.js crypto package).

Type:string
export default {
  cache: {
    hashAlgorithm: '...',
  },
};

Time in ms after which idle period the cache storing should happen.

Type:number
export default {
  cache: {
    idleTimeout: 0,
  },
};

Time in ms after which idle period the cache storing should happen when larger changes has been detected (cumulative build time > 2 x avg cache store time).

Type:number
export default {
  cache: {
    idleTimeoutAfterLargeChanges: 0,
  },
};

Time in ms after which idle period the initial cache storing should happen.

Type:number
export default {
  cache: {
    idleTimeoutForInitialStore: 0,
  },
};

List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.

Type:(RegExp | string)[]
export default {
  cache: {
    immutablePaths: [],
  },
};

List of paths that are managed by a package manager and can be trusted to not be modified otherwise.

Type:(RegExp | string)[]
export default {
  cache: {
    managedPaths: [],
  },
};

Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds).

Type:number
export default {
  cache: {
    maxAge: 0,
  },
};

Number of generations unused cache entries stay in memory cache at minimum (0 = no memory cache used, 1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Cache entries will be deserialized from disk when removed from memory cache.

Type:number
export default {
  cache: {
    maxMemoryGenerations: 0,
  },
};

Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory.

Type:boolean
export default {
  cache: {
    memoryCacheUnaffected: true,
  },
};

Name for the cache. Different names will lead to different coexisting caches.

Type:string
export default {
  cache: {
    name: '...',
  },
};

Track and log detailed timing information for individual cache items.

Type:boolean
export default {
  cache: {
    profile: true,
  },
};

Enable/disable readonly mode.

Type:boolean
export default {
  cache: {
    readonly: true,
  },
};

When to store data to the filesystem. (pack: Store data when compiler is idle in a single file).

Type:"pack"
export default {
  cache: {
    store: "pack",
  },
};

Filesystem caching.

Type:"filesystem" | "memory"
export default {
  cache: {
    type: "filesystem",
  },
};

Version of the cache data. Different versions won't allow to reuse the cache and override existing content. Update the version when config changed in a way which doesn't allow to reuse cache. This will invalidate the cache.

Type:string
export default {
  cache: {
    version: '...',
  },
};

The base directory (absolute path!) for resolving the entry option. If output.pathinfo is set, the included pathinfo is shortened to this directory.

Type:string
export default {
  context: '...',
};

References to other configurations to depend on.

Type:string[]
export default {
  dependencies: [],
};

Options for the webpack-dev-server.

Type:false | object
export default {
  devServer: false,
};

A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).

Type:object[] | false | "eval" | string
export default {
  devtool: "eval",
};

Enable and configure the Dotenv plugin to load environment variables from .env files.

export default {
  dotenv: true,
};

The directory from which .env files are loaded. Can be an absolute path, false will disable the .env file loading.

Type:false | string
export default {
  dotenv: {
    dir: '...',
  },
};

Only expose environment variables that start with these prefixes. Defaults to 'WEBPACK_'.

Type:string[] | string
export default {
  dotenv: {
    prefix: '...',
  },
};

Template patterns for .env file names. Use [mode] as placeholder for the webpack mode. Defaults to ['.env', '.env.local', '.env.[mode]', '.env.[mode].local'].

Type:string[]
export default {
  dotenv: {
    template: [],
  },
};

The entry point(s) of the compilation.

Type:RawEntryDynamic | EntryObject | string[] | string
export default {
  entry: '...',
};

Enables/Disables experiments (experimental features with relax SemVer compatibility).

export default {
  experiments: {},
};

Support WebAssembly as asynchronous EcmaScript Module.

Type:boolean
export default {
  experiments: {
    asyncWebAssembly: true,
  },
};

Enable backward-compat layer with deprecation warnings for many webpack 4 APIs.

Type:boolean
export default {
  experiments: {
    backCompat: true,
  },
};

Build http(s): urls using a lockfile and resource content cache.

Type:(RegExp | string | AllowedUriFn)[] | HttpUriOptions
allowedUris:(RegExp | string | AllowedUriFn)[]
List of allowed URIs (resp. the beginning of them).
cacheLocation:false | string
Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.
frozen:boolean
When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.
lockfileLocation:string
Location of the lockfile.
proxy:string
Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.
upgrade:boolean
When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.
export default {
  experiments: {
    buildHttp: { allowedUris: [] },
  },
};

Enable additional in memory caching of modules that are unchanged and reference only unchanged modules.

Type:boolean
export default {
  experiments: {
    cacheUnaffected: true,
  },
};

Enable css support.

Type:boolean
export default {
  experiments: {
    css: true,
  },
};

Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval. This allows to defer execution of a module until it's first use.

Type:boolean
export default {
  experiments: {
    deferImport: true,
  },
};

Apply defaults of next major version.

Type:boolean
export default {
  experiments: {
    futureDefaults: true,
  },
};

Enable experimental HTML support. This flag does not by itself make .html files usable directly as entry points without additional HTML handling.

Type:boolean
export default {
  experiments: {
    html: true,
  },
};

Compile entrypoints and import()s only when they are accessed.

Specifies the backend that should be used for handling client keep alive.
entries:boolean
Enable/disable lazy compilation for entries.
imports:boolean
Enable/disable lazy compilation for import() modules.
test:RegExp | string | TestFn
Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.
export default {
  experiments: {
    lazyCompilation: true,
  },
};

Allow output javascript files as module source type.

Type:boolean
export default {
  experiments: {
    outputModule: true,
  },
};

Enable experimental tc39 proposal https://github.com/tc39/proposal-source-phase-imports. This allows importing modules at source phase.

Type:boolean
export default {
  experiments: {
    sourceImport: true,
  },
};

Support WebAssembly as synchronous EcmaScript Module (outdated).

Type:boolean
export default {
  experiments: {
    syncWebAssembly: true,
  },
};

Enable typescript support.

Type:boolean
export default {
  experiments: {
    typescript: true,
  },
};

Extend configuration from another configuration (only works when using webpack-cli).

Type:string[] | string
export default {
  extends: '...',
};

Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on output.libraryTarget.

export default {
  externals: '...',
};

Specify externals depending on the layer.

Type:object | ExternalItemByLayerFn
export default {
  externals: {
    byLayer: {},
  },
};

Enable presets of externals for specific targets.

export default {
  externalsPresets: {},
};

Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.

Type:boolean
export default {
  externalsPresets: {
    electron: true,
  },
};

Treat electron built-in modules in the main context like 'app', 'ipc-main' or 'shell' as external and load them via require() when used.

Type:boolean
export default {
  externalsPresets: {
    electronMain: true,
  },
};

Treat electron built-in modules in the preload context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.

Type:boolean
export default {
  externalsPresets: {
    electronPreload: true,
  },
};

Treat electron built-in modules in the renderer context like 'web-frame', 'ipc-renderer' or 'shell' as external and load them via require() when used.

Type:boolean
export default {
  externalsPresets: {
    electronRenderer: true,
  },
};

Treat node.js built-in modules like fs, path or vm as external and load them via require() when used.

Type:boolean
export default {
  externalsPresets: {
    node: true,
  },
};

Treat NW.js legacy nw.gui module as external and load it via require() when used.

Type:boolean
export default {
  externalsPresets: {
    nwjs: true,
  },
};

Treat references to 'http(s)://...' and 'std:...' as external and load them via import when used (Note that this changes execution order as externals are executed before any other code in the chunk).

Type:boolean
export default {
  externalsPresets: {
    web: true,
  },
};

Treat references to 'http(s)://...' and 'std:...' as external and load them via async import() when used (Note that this external type is an async module, which has various effects on the execution).

Type:boolean
export default {
  externalsPresets: {
    webAsync: true,
  },
};

Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).

Type:"var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "promise" | "import" | "module-import" | "script" | "node-commonjs" | "asset" | "asset-url" | "css-import" | "css-url"
export default {
  externalsType: "var",
};

Ignore specific warnings.

Type:(RegExp | object | IgnoreFn)[]
export default {
  ignoreWarnings: [],
};

Options for infrastructure level logging.

export default {
  infrastructureLogging: {},
};

Only appends lines to the output. Avoids updating existing output e. g. for status messages. This option is only used when no custom console is provided.

Type:boolean
export default {
  infrastructureLogging: {
    appendOnly: true,
  },
};

Enables/Disables colorful output. This option is only used when no custom console is provided.

Type:boolean
export default {
  infrastructureLogging: {
    colors: true,
  },
};

Custom console used for logging.

Type:Console
export default {
  infrastructureLogging: {
    console: undefined,
  },
};

Enable debug logging for specific loggers.

Type:boolean | (RegExp | string | FilterItemTypeFn)[] | RegExp | string | FilterItemTypeFn
export default {
  infrastructureLogging: {
    debug: '...',
  },
};

Log level.

Type:"none" | "error" | "warn" | "info" | "log" | "verbose"
export default {
  infrastructureLogging: {
    level: "none",
  },
};

Stream used for logging output. Defaults to process.stderr. This option is only used when no custom console is provided.

Type:NodeJS.WritableStream & { isTTY?: boolean, columns?: number, rows?: number }
export default {
  infrastructureLogging: {
    stream: undefined,
  },
};

Custom values available in the loader context.

Type:Loader
export default {
  loader: {},
};

Enable production optimizations or development hints.

Type:"development" | "production" | "none"
export default {
  mode: "development",
};

Options affecting the normal modules (NormalModuleFactory).

export default {
  module: {},
};

An array of rules applied by default for modules.

Type:("..." | false | 0 | '' | null | undefined | RuleSetRule)[]
export default {
  module: {
    defaultRules: [],
  },
};
Stability: 0Deprecated

Enable warnings for full dynamic dependencies.

Type:boolean
export default {
  module: {
    exprContextCritical: true,
  },
};
Stability: 0Deprecated

Enable recursive directory lookup for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRecursive'.

Type:boolean
export default {
  module: {
    exprContextRecursive: true,
  },
};
Stability: 0Deprecated

Sets the default regular expression for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRegExp'.

export default {
  module: {
    exprContextRegExp: true,
  },
};
Stability: 0Deprecated

Set the default request for full dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.exprContextRequest'.

Type:string
export default {
  module: {
    exprContextRequest: '...',
  },
};

Specify options for each generator.

Generator options for asset modules.
No generator options are supported for this module type.
Generator options for asset/inline modules.
Generator options for asset/resource modules.
No generator options are supported for this module type.
Generator options for css modules.
Generator options for css/module modules.
Generator options for css/module modules.
Generator options for css/module modules.
Generator options for html modules.
No generator options are supported for this module type.
javascript/auto:EmptyGeneratorOptions
No generator options are supported for this module type.
javascript/dynamic:EmptyGeneratorOptions
No generator options are supported for this module type.
javascript/esm:EmptyGeneratorOptions
No generator options are supported for this module type.
Generator options for json modules.
export default {
  module: {
    generator: {},
  },
};

Don't parse files matching. It's matched against the full resolved request.

Type:(RegExp | string | NoParseFn)[] | RegExp | string | NoParseFn
export default {
  module: {
    noParse: '...',
  },
};

Specify options for each parser.

Parser options for asset modules.
asset/bytes:EmptyParserOptions
No parser options are supported for this module type.
asset/inline:EmptyParserOptions
No parser options are supported for this module type.
asset/resource:EmptyParserOptions
No parser options are supported for this module type.
asset/source:EmptyParserOptions
No parser options are supported for this module type.
Parser options for css modules.
Parser options for css/auto and css/module modules.
Parser options for css/global modules.
Parser options for css/auto and css/module modules.
Parser options for javascript modules.
javascript/auto:JavascriptParserOptions
Parser options for javascript modules.
javascript/dynamic:JavascriptParserOptions
Parser options for javascript modules.
Parser options for javascript modules.
Parser options for JSON modules.
export default {
  module: {
    parser: {},
  },
};

An array of rules applied for modules.

Type:("..." | false | 0 | '' | null | undefined | RuleSetRule)[]
export default {
  module: {
    rules: [],
  },
};
Stability: 0Deprecated

Emit errors instead of warnings when imported names don't exist in imported module. Deprecated: This option has moved to 'module.parser.javascript.strictExportPresence'.

Type:boolean
export default {
  module: {
    strictExportPresence: true,
  },
};
Stability: 0Deprecated

Handle the this context correctly according to the spec for namespace objects. Deprecated: This option has moved to 'module.parser.javascript.strictThisContextOnImports'.

Type:boolean
export default {
  module: {
    strictThisContextOnImports: true,
  },
};
Stability: 0Deprecated

Enable warnings when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextCritical'.

Type:boolean
export default {
  module: {
    unknownContextCritical: true,
  },
};
Stability: 0Deprecated

Enable recursive directory lookup when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRecursive'.

Type:boolean
export default {
  module: {
    unknownContextRecursive: true,
  },
};
Stability: 0Deprecated

Sets the regular expression when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRegExp'.

export default {
  module: {
    unknownContextRegExp: true,
  },
};
Stability: 0Deprecated

Sets the request when using the require function in a not statically analyse-able way. Deprecated: This option has moved to 'module.parser.javascript.unknownContextRequest'.

Type:string
export default {
  module: {
    unknownContextRequest: '...',
  },
};

Cache the resolving of module requests.

Type:boolean | UnsafeCachePredicate
export default {
  module: {
    unsafeCache: true,
  },
};
Stability: 0Deprecated

Enable warnings for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextCritical'.

Type:boolean
export default {
  module: {
    wrappedContextCritical: true,
  },
};
Stability: 0Deprecated

Enable recursive directory lookup for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRecursive'.

Type:boolean
export default {
  module: {
    wrappedContextRecursive: true,
  },
};
Stability: 0Deprecated

Set the inner regular expression for partial dynamic dependencies. Deprecated: This option has moved to 'module.parser.javascript.wrappedContextRegExp'.

Type:RegExp
export default {
  module: {
    wrappedContextRegExp: undefined,
  },
};

Name of the configuration. Used when loading multiple configurations.

Type:string
export default {
  name: '...',
};

Include polyfills or mocks for various node stuff.

Type:false | NodeOptions
export default {
  node: false,
};

Include a polyfill for the '__dirname' variable.

Type:false | true | "warn-mock" | "mock" | "node-module" | "eval-only"
export default {
  node: {
    __dirname: "warn-mock",
  },
};

Include a polyfill for the '__filename' variable.

Type:false | true | "warn-mock" | "mock" | "node-module" | "eval-only"
export default {
  node: {
    __filename: "warn-mock",
  },
};

Include a polyfill for the 'global' variable.

Type:false | true | "warn"
export default {
  node: {
    global: "warn",
  },
};

Enables/Disables integrated optimizations.

export default {
  optimization: {},
};

Avoid wrapping the entry module in an IIFE.

Type:boolean
export default {
  optimization: {
    avoidEntryIife: true,
  },
};

Check for incompatible wasm types when importing/exporting from/to ESM.

Type:boolean
export default {
  optimization: {
    checkWasmTypes: true,
  },
};

Define the algorithm to choose chunk ids (named: readable ids for better debugging, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, total-size: numeric ids focused on minimal total download size, false: no algorithm used, as custom one can be provided via plugin).

Type:"natural" | "named" | "deterministic" | "size" | "total-size" | false
export default {
  optimization: {
    chunkIds: "natural",
  },
};

Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer.

Type:boolean
export default {
  optimization: {
    concatenateModules: true,
  },
};

Emit assets even when errors occur. Critical errors are emitted into the generated code and will cause errors at runtime.

Type:boolean
export default {
  optimization: {
    emitOnErrors: true,
  },
};

Also flag chunks as loaded which contain a subset of the modules.

Type:boolean
export default {
  optimization: {
    flagIncludedChunks: true,
  },
};

Creates a module-internal dependency graph for top level symbols, exports and imports, to improve unused exports detection.

Type:boolean
export default {
  optimization: {
    innerGraph: true,
  },
};

Rename exports when possible to generate shorter code (depends on optimization.usedExports and optimization.providedExports, true/"deterministic": generate short deterministic names optimized for caching, "size": generate the shortest possible names).

Type:"size" | "deterministic" | boolean
export default {
  optimization: {
    mangleExports: "size",
  },
};

Reduce size of WASM by changing imports to shorter strings.

Type:boolean
export default {
  optimization: {
    mangleWasmImports: true,
  },
};

Merge chunks which contain the same modules.

Type:boolean
export default {
  optimization: {
    mergeDuplicateChunks: true,
  },
};

Enable minimizing the output. Uses optimization.minimizer.

Type:boolean
export default {
  optimization: {
    minimize: true,
  },
};

Minimizer(s) to use for minimizing the output.

Type:("..." | false | 0 | '' | null | undefined | WebpackPluginInstance | WebpackPluginFunction)[]
export default {
  optimization: {
    minimizer: [],
  },
};

Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).

Type:"natural" | "named" | "hashed" | "deterministic" | "size" | false
export default {
  optimization: {
    moduleIds: "natural",
  },
};
Stability: 0Deprecated

Avoid emitting assets when errors occur (deprecated: use 'emitOnErrors' instead).

Type:boolean
export default {
  optimization: {
    noEmitOnErrors: true,
  },
};

Set process.env.NODE_ENV to a specific value.

Type:false | string
export default {
  optimization: {
    nodeEnv: '...',
  },
};

Generate records with relative paths to be able to move the context folder.

Type:boolean
export default {
  optimization: {
    portableRecords: true,
  },
};

Figure out which exports are provided by modules to generate more efficient code.

Type:boolean
export default {
  optimization: {
    providedExports: true,
  },
};

Use real [contenthash] based on final content of the assets.

Type:boolean
export default {
  optimization: {
    realContentHash: true,
  },
};

Removes modules from chunks when these modules are already included in all parents.

Type:boolean
export default {
  optimization: {
    removeAvailableModules: true,
  },
};

Remove chunks which are empty.

Type:boolean
export default {
  optimization: {
    removeEmptyChunks: true,
  },
};

Create an additional chunk which contains only the webpack runtime and chunk hash maps.

Type:"single" | "multiple" | boolean | object
name:string | RuntimeChunkFunction
The name or name factory for the runtime chunks.
export default {
  optimization: {
    runtimeChunk: "single",
  },
};

Skip over modules which contain no side effects when exports are not used (false: disabled, 'flag': only use manually placed side effects flag, true: also analyse source code for side effects).

Type:"flag" | boolean
export default {
  optimization: {
    sideEffects: "flag",
  },
};

Optimize duplication and caching by splitting chunks by shared modules and cache group.

automaticNameDelimiter:string
Sets the name delimiter for created chunks.
cacheGroups:object
Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').
chunks:"initial" | "async" | "all" | RegExp | ChunkFilterFn
Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).
defaultSizeTypes:SourceType[]
Sets the size types which are used when a number is used for sizes.
enforceSizeThreshold:number | object
Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.
fallbackCacheGroup:object
Options for modules not selected by any other cache group.
Sets the template for the filename for created chunks.
hidePathInfo:boolean
Prevents exposing path info when creating names for parts splitted by maxSize.
maxAsyncRequests:number
Maximum number of requests which are accepted for on-demand loading.
maxAsyncSize:number | object
Maximal size hint for the on-demand chunks.
maxInitialRequests:number
Maximum number of initial chunks which are accepted for an entry point.
maxInitialSize:number | object
Maximal size hint for the initial chunks.
maxSize:number | object
Maximal size hint for the created chunks.
minChunks:number
Minimum number of times a module has to be duplicated until it's considered for splitting.
minRemainingSize:number | object
Minimal size for the chunks the stay after moving the modules to a new chunk.
minSize:number | object
Minimal size for the created chunks.
minSizeReduction:number | object
Minimum size reduction due to the created chunk.
name:false | string | GetNameFn
Give chunks created a name (chunks with equal name are merged).
usedExports:boolean
Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.
export default {
  optimization: {
    splitChunks: false,
  },
};

Figure out which exports are used by modules to mangle export names, omit unused exports and generate more efficient code (true: analyse used exports for each runtime, "global": analyse exports globally for all runtimes combined).

Type:"global" | boolean
export default {
  optimization: {
    usedExports: "global",
  },
};

Options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.

Type:Output
export default {
  output: {},
};
Type:string
export default {
  output: {
    amdContainer: '...',
  },
};

The filename of asset modules as relative path inside the 'output.path' directory.

export default {
  output: {
    assetModuleFilename: '...',
  },
};

Enable/disable creating async chunks that are loaded on demand.

Type:boolean
export default {
  output: {
    asyncChunks: true,
  },
};
amd:string
Set comment for amd section in UMD.
commonjs:string
Set comment for commonjs (exports) section in UMD.
commonjs2:string
Set comment for commonjs2 (module.exports) section in UMD.
root:string
Set comment for root (global variable) section in UMD.
export default {
  output: {
    auxiliaryComment: '...',
  },
};

Add charset attribute for script tag.

Type:boolean
export default {
  output: {
    charset: true,
  },
};

Specifies the filename template of output files of non-initial chunks on disk. You must not specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.

export default {
  output: {
    chunkFilename: '...',
  },
};

The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), 'module' (ESM), but others might be added by plugins).

Type:"array-push" | "commonjs" | "module" | false | string
export default {
  output: {
    chunkFormat: "array-push",
  },
};

Number of milliseconds before chunk request expires.

Type:number
export default {
  output: {
    chunkLoadTimeout: 0,
  },
};

The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).

Type:false | "jsonp" | "import-scripts" | "require" | "async-node" | "import" | string
export default {
  output: {
    chunkLoading: "jsonp",
  },
};

The global variable used by webpack for loading of chunks.

Type:string
export default {
  output: {
    chunkLoadingGlobal: '...',
  },
};

Clean the output directory before emit.

Log the assets that should be removed instead of deleting them.
keep:RegExp | string | KeepFn
Keep these assets.
export default {
  output: {
    clean: true,
  },
};

Check if to be emitted file already exists and have the same content before writing to output filesystem.

Type:boolean
export default {
  output: {
    compareBeforeEmit: true,
  },
};

This option enables cross-origin loading of chunks.

Type:false | "anonymous" | "use-credentials"
export default {
  output: {
    crossOriginLoading: "anonymous",
  },
};

Specifies the filename template of non-initial output css files on disk. You must not specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.

export default {
  output: {
    cssChunkFilename: '...',
  },
};

Specifies the filename template of output css files on disk. You must not specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.

export default {
  output: {
    cssFilename: '...',
  },
};

Similar to output.devtoolModuleFilenameTemplate, but used in the case of duplicate module identifiers.

Type:string | ModuleFilenameTemplateFunction
export default {
  output: {
    devtoolFallbackModuleFilenameTemplate: '...',
  },
};

Filename template string of function for the sources array in a generated SourceMap.

Type:string | ModuleFilenameTemplateFunction
export default {
  output: {
    devtoolModuleFilenameTemplate: '...',
  },
};

Module namespace to use when interpolating filename template string for the sources array in a generated SourceMap. Defaults to output.library if not set. It's useful for avoiding runtime collisions in sourcemaps from multiple webpack projects built as libraries.

Type:string
export default {
  output: {
    devtoolNamespace: '...',
  },
};

List of chunk loading types enabled for use by entry points.

Type:("jsonp" | "import-scripts" | "require" | "async-node" | "import" | string)[]
export default {
  output: {
    enabledChunkLoadingTypes: [],
  },
};

List of library types enabled for use by entry points.

Type:("var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | string)[]
export default {
  output: {
    enabledLibraryTypes: [],
  },
};

List of wasm loading types enabled for use by entry points.

Type:("fetch" | "async-node" | string)[]
export default {
  output: {
    enabledWasmLoadingTypes: [],
  },
};

The abilities of the environment where the webpack generated code should run.

arrowFunction:boolean
The environment supports arrow functions ('() => ... ').
asyncFunction:boolean
The environment supports async function and await ('async function () await ... ').
bigIntLiteral:boolean
The environment supports BigInt as literal (123n).
const:boolean
The environment supports const and let for variable declarations.
destructuring:boolean
The environment supports destructuring (' a, b = obj').
document:boolean
The environment supports 'document'.
dynamicImport:boolean
The environment supports an async import() function to import EcmaScript modules.
dynamicImportInWorker:boolean
The environment supports an async import() is available when creating a worker.
forOf:boolean
The environment supports 'for of' iteration ('for (const x of array) ... ').
globalThis:boolean
The environment supports 'globalThis'.
importMetaDirnameAndFilename:boolean
The environment supports import.meta.dirname and import.meta.filename .
methodShorthand:boolean
The environment supports object method shorthand (' module() {} ').
module:boolean
The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').
nodePrefixForCoreModules:boolean
The environment supports node: prefix for Node.js core modules.
optionalChaining:boolean
The environment supports optional chaining ('obj?.a' or 'obj?.()').
templateLiteral:boolean
The environment supports template literals.
export default {
  output: {
    environment: {},
  },
};

Specifies the filename of output files on disk. You must not specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.

export default {
  output: {
    filename: '...',
  },
};

An expression which is used to address the global object/scope in runtime code.

Type:string
export default {
  output: {
    globalObject: '...',
  },
};

Digest types used for the hash.

Type:string
export default {
  output: {
    hashDigest: '...',
  },
};

Number of chars which are used for the hash.

Type:number
export default {
  output: {
    hashDigestLength: 0,
  },
};

Algorithm used for generation the hash (see node.js crypto package).

export default {
  output: {
    hashFunction: '...',
  },
};

Any string which is added to the hash to salt it.

Type:string
export default {
  output: {
    hashSalt: '...',
  },
};

The filename of the Hot Update Chunks. They are inside the output.path directory.

Type:string
export default {
  output: {
    hotUpdateChunkFilename: '...',
  },
};

The global variable used by webpack for loading of hot update chunks.

Type:string
export default {
  output: {
    hotUpdateGlobal: '...',
  },
};

The filename of the Hot Update Main File. It is inside the 'output.path' directory.

Type:string
export default {
  output: {
    hotUpdateMainFilename: '...',
  },
};

Specifies the filename template of non-initial output html files on disk. You must not specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.

export default {
  output: {
    htmlChunkFilename: '...',
  },
};

Specifies the filename template of output html files on disk. You must not specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.

export default {
  output: {
    htmlFilename: '...',
  },
};

Ignore warnings in the browser.

Type:boolean
export default {
  output: {
    ignoreBrowserWarnings: true,
  },
};

Wrap javascript code into IIFE's to avoid leaking into global scope.

Type:boolean
export default {
  output: {
    iife: true,
  },
};

The name of the native import() function (can be exchanged for a polyfill).

Type:string
export default {
  output: {
    importFunctionName: '...',
  },
};

The name of the native import.meta object (can be exchanged for a polyfill).

Type:string
export default {
  output: {
    importMetaName: '...',
  },
};

Make the output files a library, exporting the exports of the entry point.

amdContainer:string
Add a container for define/require functions in the AMD module.
Add a comment in the UMD wrapper.
export:string[] | string
Specify which export should be exposed as library.
The name of the library (some types allow unnamed libraries too).
type:"var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | string
Type of library (types included by default are 'var', 'module', 'assign', 'assign-properties', 'this', 'window', 'self', 'global', 'commonjs', 'commonjs2', 'commonjs-module', 'commonjs-static', 'amd', 'amd-require', 'umd', 'umd2', 'jsonp', 'system', but others might be added by plugins).
umdNamedDefine:boolean
If output.libraryTarget is set to umd and output.library is set, setting this to true will name the AMD module.
export default {
  output: {
    library: { type: "var" },
  },
};
Type:string[] | string
export default {
  output: {
    libraryExport: '...',
  },
};
Type:"var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | string
export default {
  output: {
    libraryTarget: "var",
  },
};

Output javascript files as module source type.

Type:boolean
export default {
  output: {
    module: true,
  },
};

The output directory as absolute path (required).

Type:string
export default {
  output: {
    path: '...',
  },
};

Include comments with information about the modules.

Type:"verbose" | boolean
export default {
  output: {
    pathinfo: "verbose",
  },
};

The 'publicPath' specifies the public URL address of the output files when referenced in a browser.

Type:"auto" | string | TemplatePathFn
export default {
  output: {
    publicPath: "auto",
  },
};

This option enables loading async chunks via a custom script type, such as script type="module".

Type:false | "text/javascript" | "module"
export default {
  output: {
    scriptType: "text/javascript",
  },
};

The filename of the SourceMaps for the JavaScript files. They are inside the 'output.path' directory.

Type:string
export default {
  output: {
    sourceMapFilename: '...',
  },
};

Prefixes every line of the source in the bundle with this string.

Type:string
export default {
  output: {
    sourcePrefix: '...',
  },
};

Handles error in module loading correctly at a performance cost. This will handle module error compatible with the EcmaScript Modules spec.

Type:boolean
export default {
  output: {
    strictModuleErrorHandling: true,
  },
};
Stability: 0Deprecated

Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.

Type:boolean
export default {
  output: {
    strictModuleExceptionHandling: true,
  },
};

Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name.

Type:true | string | TrustedTypes
onPolicyCreationFailure:"continue" | "stop"
If the call to trustedTypes.createPolicy(...) fails -- e.g., due to the policy name missing from the CSP trusted-types list, or it being a duplicate name, etc. -- controls whether to continue with loading in the hope that require-trusted-types-for 'script' isn't enforced yet, versus fail immediately. Default behavior is 'stop'.
policyName:string
The name of the Trusted Types policy created by webpack to serve bundle chunks.
export default {
  output: {
    trustedTypes: '...',
  },
};
Type:boolean
export default {
  output: {
    umdNamedDefine: true,
  },
};

A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.

Type:string
export default {
  output: {
    uniqueName: '...',
  },
};

The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).

Type:false | "fetch" | "async-node" | string
export default {
  output: {
    wasmLoading: "fetch",
  },
};

The filename of WebAssembly modules as relative path inside the 'output.path' directory.

Type:string
export default {
  output: {
    webassemblyModuleFilename: '...',
  },
};

The method of loading chunks (methods included by default are 'jsonp' (web), 'import' (ESM), 'importScripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).

Type:false | "jsonp" | "import-scripts" | "require" | "async-node" | "import" | string
export default {
  output: {
    workerChunkLoading: "jsonp",
  },
};

Worker public path. Much like the public path, this sets the location where the worker script file is intended to be found. If not set, webpack will use the publicPath. Don't set this option unless your worker scripts are located at a different path from your other script files.

Type:string
export default {
  output: {
    workerPublicPath: '...',
  },
};

The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).

Type:false | "fetch" | "async-node" | string
export default {
  output: {
    workerWasmLoading: "fetch",
  },
};

The number of parallel processed modules in the compilation.

Type:number
export default {
  parallelism: 0,
};

Configuration for web performance recommendations.

Type:false | PerformanceOptions
export default {
  performance: false,
};

Filter function to select assets that are checked.

Type:AssetFilter
export default {
  performance: {
    assetFilter: () => {},
  },
};

Sets the format of the hints: warnings, errors or nothing at all.

Type:false | "warning" | "error"
export default {
  performance: {
    hints: "warning",
  },
};

File size limit (in bytes) when exceeded, that webpack will provide performance hints.

Type:number
export default {
  performance: {
    maxAssetSize: 0,
  },
};

Total size of an entry point (in bytes).

Type:number
export default {
  performance: {
    maxEntrypointSize: 0,
  },
};

Add additional plugins to the compiler.

Type:(false | 0 | '' | null | undefined | WebpackPluginInstance | WebpackPluginFunction)[]
export default {
  plugins: [],
};

Capture timing information for each module.

Type:boolean
export default {
  profile: true,
};

Store compiler state to a json file.

Type:false | string
export default {
  recordsInputPath: '...',
};

Load compiler state from a json file.

Type:false | string
export default {
  recordsOutputPath: '...',
};

Store/Load compiler state from/to a json file. This will result in persistent ids of modules and chunks. An absolute path is expected. recordsPath is used for recordsInputPath and recordsOutputPath if they left undefined.

Type:false | string
export default {
  recordsPath: '...',
};

Options for the resolver.

export default {
  resolve: {},
};

Redirect module requests.

Type:object[] | object
export default {
  resolve: {
    alias: [],
  },
};

Fields in the description file (usually package.json) which are used to redirect requests inside the module.

Type:(string[] | string)[]
export default {
  resolve: {
    aliasFields: [],
  },
};

Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".

Type:object
export default {
  resolve: {
    byDependency: {},
  },
};

Enable caching of successfully resolved requests (cache entries are revalidated).

Type:boolean
export default {
  resolve: {
    cache: true,
  },
};

Predicate function to decide which requests should be cached.

Type:((request: ResolveRequest) => boolean)
export default {
  resolve: {
    cachePredicate: () => {},
  },
};

Include the context information in the cache identifier when caching.

Type:boolean
export default {
  resolve: {
    cacheWithContext: true,
  },
};

Condition names for exports field entry point.

Type:string[]
export default {
  resolve: {
    conditionNames: [],
  },
};

Filenames used to find a description file (like a package.json).

Type:string[]
export default {
  resolve: {
    descriptionFiles: [],
  },
};

Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).

Type:boolean
export default {
  resolve: {
    enforceExtension: true,
  },
};

Field names from the description file (usually package.json) which are used to provide entry points of a package.

Type:string[]
export default {
  resolve: {
    exportsFields: [],
  },
};

An object which maps extension to extension aliases.

Type:object
export default {
  resolve: {
    extensionAlias: {},
  },
};

Extensions added to the request when trying to find the file.

Type:string[]
export default {
  resolve: {
    extensions: [],
  },
};

Redirect module requests when normal resolving fails.

Type:object[] | object
export default {
  resolve: {
    fallback: [],
  },
};

Filesystem for the resolver.

export default {
  resolve: {
    fileSystem: undefined,
  },
};

Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).

Type:boolean
export default {
  resolve: {
    fullySpecified: true,
  },
};

Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).

Type:string[]
export default {
  resolve: {
    importsFields: [],
  },
};

Field names from the description file (package.json) which are used to find the default entry point.

Type:(string[] | string)[]
export default {
  resolve: {
    mainFields: [],
  },
};

Filenames used to find the default entry point if there is no description file or main field.

Type:string[]
export default {
  resolve: {
    mainFiles: [],
  },
};

Folder names or directory paths where to find modules.

Type:string[]
export default {
  resolve: {
    modules: [],
  },
};

Plugins for the resolver.

Type:("..." | false | 0 | '' | null | undefined | object | ((this: Resolver, arg1: Resolver) => void))[]
export default {
  resolve: {
    plugins: [],
  },
};

Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.

Type:boolean
export default {
  resolve: {
    preferAbsolute: true,
  },
};

Prefer to resolve module requests as relative request and fallback to resolving as module.

Type:boolean
export default {
  resolve: {
    preferRelative: true,
  },
};

Custom resolver.

export default {
  resolve: {
    resolver: undefined,
  },
};

A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.

Type:(RegExp | string)[]
export default {
  resolve: {
    restrictions: [],
  },
};

A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.

Type:string[]
export default {
  resolve: {
    roots: [],
  },
};

Enable resolving symlinks to the original location.

Type:boolean
export default {
  resolve: {
    symlinks: true,
  },
};

TypeScript config for paths mapping. Can be false (disabled), true (use default tsconfig.json), a string path to tsconfig.json, or an object with configFile and references options.

configFile:string
A path to the tsconfig file.
references:"auto" | string
References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths.
export default {
  resolve: {
    tsconfig: '...',
  },
};

Enable caching of successfully resolved requests (cache entries are not revalidated).

export default {
  resolve: {
    unsafeCache: true,
  },
};

Use synchronous filesystem calls for the resolver.

Type:boolean
export default {
  resolve: {
    useSyncFileSystemCalls: true,
  },
};

Options for the resolver when resolving loaders.

export default {
  resolveLoader: {},
};

Redirect module requests.

Type:object[] | object
export default {
  resolveLoader: {
    alias: [],
  },
};

Fields in the description file (usually package.json) which are used to redirect requests inside the module.

Type:(string[] | string)[]
export default {
  resolveLoader: {
    aliasFields: [],
  },
};

Extra resolve options per dependency category. Typical categories are "commonjs", "amd", "esm".

Type:object
export default {
  resolveLoader: {
    byDependency: {},
  },
};

Enable caching of successfully resolved requests (cache entries are revalidated).

Type:boolean
export default {
  resolveLoader: {
    cache: true,
  },
};

Predicate function to decide which requests should be cached.

Type:((request: ResolveRequest) => boolean)
export default {
  resolveLoader: {
    cachePredicate: () => {},
  },
};

Include the context information in the cache identifier when caching.

Type:boolean
export default {
  resolveLoader: {
    cacheWithContext: true,
  },
};

Condition names for exports field entry point.

Type:string[]
export default {
  resolveLoader: {
    conditionNames: [],
  },
};

Filenames used to find a description file (like a package.json).

Type:string[]
export default {
  resolveLoader: {
    descriptionFiles: [],
  },
};

Enforce the resolver to use one of the extensions from the extensions option (User must specify requests without extension).

Type:boolean
export default {
  resolveLoader: {
    enforceExtension: true,
  },
};

Field names from the description file (usually package.json) which are used to provide entry points of a package.

Type:string[]
export default {
  resolveLoader: {
    exportsFields: [],
  },
};

An object which maps extension to extension aliases.

Type:object
export default {
  resolveLoader: {
    extensionAlias: {},
  },
};

Extensions added to the request when trying to find the file.

Type:string[]
export default {
  resolveLoader: {
    extensions: [],
  },
};

Redirect module requests when normal resolving fails.

Type:object[] | object
export default {
  resolveLoader: {
    fallback: [],
  },
};

Filesystem for the resolver.

export default {
  resolveLoader: {
    fileSystem: undefined,
  },
};

Treats the request specified by the user as fully specified, meaning no extensions are added and the mainFiles in directories are not resolved (This doesn't affect requests from mainFields, aliasFields or aliases).

Type:boolean
export default {
  resolveLoader: {
    fullySpecified: true,
  },
};

Field names from the description file (usually package.json) which are used to provide internal request of a package (requests starting with # are considered as internal).

Type:string[]
export default {
  resolveLoader: {
    importsFields: [],
  },
};

Field names from the description file (package.json) which are used to find the default entry point.

Type:(string[] | string)[]
export default {
  resolveLoader: {
    mainFields: [],
  },
};

Filenames used to find the default entry point if there is no description file or main field.

Type:string[]
export default {
  resolveLoader: {
    mainFiles: [],
  },
};

Folder names or directory paths where to find modules.

Type:string[]
export default {
  resolveLoader: {
    modules: [],
  },
};

Plugins for the resolver.

Type:("..." | false | 0 | '' | null | undefined | object | ((this: Resolver, arg1: Resolver) => void))[]
export default {
  resolveLoader: {
    plugins: [],
  },
};

Prefer to resolve server-relative URLs (starting with '/') as absolute paths before falling back to resolve in 'resolve.roots'.

Type:boolean
export default {
  resolveLoader: {
    preferAbsolute: true,
  },
};

Prefer to resolve module requests as relative request and fallback to resolving as module.

Type:boolean
export default {
  resolveLoader: {
    preferRelative: true,
  },
};

Custom resolver.

export default {
  resolveLoader: {
    resolver: undefined,
  },
};

A list of resolve restrictions. Resolve results must fulfill all of these restrictions to resolve successfully. Other resolve paths are taken when restrictions are not met.

Type:(RegExp | string)[]
export default {
  resolveLoader: {
    restrictions: [],
  },
};

A list of directories in which requests that are server-relative URLs (starting with '/') are resolved.

Type:string[]
export default {
  resolveLoader: {
    roots: [],
  },
};

Enable resolving symlinks to the original location.

Type:boolean
export default {
  resolveLoader: {
    symlinks: true,
  },
};

TypeScript config for paths mapping. Can be false (disabled), true (use default tsconfig.json), a string path to tsconfig.json, or an object with configFile and references options.

configFile:string
A path to the tsconfig file.
references:"auto" | string
References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths.
export default {
  resolveLoader: {
    tsconfig: '...',
  },
};

Enable caching of successfully resolved requests (cache entries are not revalidated).

export default {
  resolveLoader: {
    unsafeCache: true,
  },
};

Use synchronous filesystem calls for the resolver.

Type:boolean
export default {
  resolveLoader: {
    useSyncFileSystemCalls: true,
  },
};

Options affecting how file system snapshots are created and validated.

Type:SnapshotOptions
export default {
  snapshot: {},
};

Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.
export default {
  snapshot: {
    buildDependencies: {},
  },
};

Options for snapshotting the context module to determine if it needs to be built again.

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.
export default {
  snapshot: {
    contextModule: {},
  },
};

List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.

Type:(RegExp | string)[]
export default {
  snapshot: {
    immutablePaths: [],
  },
};

List of paths that are managed by a package manager and can be trusted to not be modified otherwise.

Type:(RegExp | string)[]
export default {
  snapshot: {
    managedPaths: [],
  },
};

Options for snapshotting dependencies of modules to determine if they need to be built again.

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.
export default {
  snapshot: {
    module: {},
  },
};

Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.
export default {
  snapshot: {
    resolve: {},
  },
};

Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.
export default {
  snapshot: {
    resolveBuildDependencies: {},
  },
};

List of paths that are not managed by a package manager and the contents are subject to change.

Type:(RegExp | string)[]
export default {
  snapshot: {
    unmanagedPaths: [],
  },
};

Stats options object or preset name.

Type:"none" | "summary" | "errors-only" | "errors-warnings" | "minimal" | "normal" | "detailed" | "verbose" | boolean | StatsOptions
export default {
  stats: "none",
};

Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).

Type:boolean
export default {
  stats: {
    all: true,
  },
};

Add assets information.

Type:boolean
export default {
  stats: {
    assets: true,
  },
};

Sort the assets by that field.

Type:false | string
export default {
  stats: {
    assetsSort: '...',
  },
};

Space to display assets (groups will be collapsed to fit this space).

Type:number
export default {
  stats: {
    assetsSpace: 0,
  },
};

Add built at time information.

Type:boolean
export default {
  stats: {
    builtAt: true,
  },
};
Stability: 0Deprecated

Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).

Type:boolean
export default {
  stats: {
    cached: true,
  },
};

Show cached assets (setting this to false only shows emitted files).

Type:boolean
export default {
  stats: {
    cachedAssets: true,
  },
};

Add information about cached (not built) modules.

Type:boolean
export default {
  stats: {
    cachedModules: true,
  },
};

Add children information.

Type:("none" | "summary" | "errors-only" | "errors-warnings" | "minimal" | "normal" | "detailed" | "verbose" | boolean | StatsOptions)[] | "none" | "summary" | "errors-only" | "errors-warnings" | "minimal" | "normal" | "detailed" | "verbose" | boolean | StatsOptions
Fallback value for stats options when an option is not defined (has precedence over local webpack defaults).
assets:boolean
Add assets information.
assetsSort:false | string
Sort the assets by that field.
assetsSpace:number
Space to display assets (groups will be collapsed to fit this space).
builtAt:boolean
Add built at time information.
cached:boolean
Deprecated. Add information about cached (not built) modules (deprecated: use 'cachedModules' instead).
cachedAssets:boolean
Show cached assets (setting this to false only shows emitted files).
cachedModules:boolean
Add information about cached (not built) modules.
children:("none" | "summary" | "errors-only" | "errors-warnings" | "minimal" | "normal" | "detailed" | "verbose" | boolean | StatsOptions)[] | "none" | "summary" | "errors-only" | "errors-warnings" | "minimal" | "normal" | "detailed" | "verbose" | boolean | StatsOptions
Add children information.
chunkGroupAuxiliary:boolean
Display auxiliary assets in chunk groups.
chunkGroupChildren:boolean
Display children of chunk groups.
chunkGroupMaxAssets:number
Limit of assets displayed in chunk groups.
chunkGroups:boolean
Display all chunk groups with the corresponding bundles.
chunkModules:boolean
Add built modules information to chunk information.
chunkModulesSpace:number
Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).
chunkOrigins:boolean
Add the origins of chunks and chunk merging info.
chunkRelations:boolean
Add information about parent, children and sibling chunks to chunk information.
chunks:boolean
Add chunk information.
chunksSort:false | string
Sort the chunks by that field.
colors:boolean | object
Enables/Disables colorful output.
context:string
Context directory for request shortening.
dependentModules:boolean
Show chunk modules that are dependencies of other modules of the chunk.
depth:boolean
Add module depth in module graph.
entrypoints:"auto" | boolean
Display the entry points with the corresponding bundles.
Add --env information.
errorCause:"auto" | boolean
Add cause to errors.
errorDetails:"auto" | boolean
Add details to errors (like resolving log).
errorErrors:"auto" | boolean
Add nested errors to errors (like in AggregateError).
errorStack:boolean
Add internal stack trace to errors.
errors:boolean
Add errors.
errorsCount:boolean
Add errors count.
errorsSpace:number
Space to display errors (value is in number of lines).
exclude:boolean | (RegExp | string | ModuleFilterItemTypeFn)[] | RegExp | string | ModuleFilterItemTypeFn
Please use excludeModules instead.
excludeAssets:(RegExp | string | AssetFilterItemFn)[] | RegExp | string | AssetFilterItemFn
Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
excludeModules:boolean | (RegExp | string | ModuleFilterItemTypeFn)[] | RegExp | string | ModuleFilterItemTypeFn
Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
groupAssetsByChunk:boolean
Group assets by how their are related to chunks.
groupAssetsByEmitStatus:boolean
Group assets by their status (emitted, compared for emit or cached).
groupAssetsByExtension:boolean
Group assets by their extension.
groupAssetsByInfo:boolean
Group assets by their asset info (immutable, development, hotModuleReplacement, etc).
groupAssetsByPath:boolean
Group assets by their path.
groupModulesByAttributes:boolean
Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).
groupModulesByCacheStatus:boolean
Group modules by their status (cached or built and cacheable).
groupModulesByExtension:boolean
Group modules by their extension.
groupModulesByLayer:boolean
Group modules by their layer.
groupModulesByPath:boolean
Group modules by their path.
groupModulesByType:boolean
Group modules by their type.
groupReasonsByOrigin:boolean
Group reasons by their origin module.
hash:boolean
Add the hash of the compilation.
Add ids.
logging:"none" | "error" | "warn" | "info" | "log" | "verbose" | boolean
Add logging output.
loggingDebug:boolean | (RegExp | string | FilterItemTypeFn)[] | RegExp | string | FilterItemTypeFn
Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.
loggingTrace:boolean
Add stack traces to logging output.
moduleAssets:boolean
Add information about assets inside modules.
moduleTrace:boolean
Add dependencies and origin of warnings/errors.
modules:boolean
Add built modules information.
modulesSort:false | string
Sort the modules by that field.
modulesSpace:number
Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).
nestedModules:boolean
Add information about modules nested in other modules (like with module concatenation).
nestedModulesSpace:number
Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).
optimizationBailout:boolean
Show reasons why optimization bailed out for modules.
orphanModules:boolean
Add information about orphan modules.
outputPath:boolean
Add output path information.
performance:boolean
Add performance hint flags.
preset:boolean | string
Preset for the default values.
providedExports:boolean
Show exports provided by modules.
publicPath:boolean
Add public path information.
reasons:boolean
Add information about the reasons why modules are included.
reasonsSpace:number
Space to display reasons (groups will be collapsed to fit this space).
relatedAssets:boolean
Add information about assets that are related to other assets (like SourceMaps for assets).
runtime:boolean
Deprecated. Add information about runtime modules (deprecated: use 'runtimeModules' instead).
runtimeModules:boolean
Add information about runtime modules.
source:boolean
Add the source code of modules.
timings:boolean
Add timing information.
usedExports:boolean
Show exports used by modules.
version:boolean
Add webpack version information.
warnings:boolean
Add warnings.
warningsCount:boolean
Add warnings count.
warningsFilter:(RegExp | string | WarningFilterFn)[] | RegExp | string | WarningFilterFn
Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
warningsSpace:number
Space to display warnings (value is in number of lines).
export default {
  stats: {
    children: "none",
  },
};

Display auxiliary assets in chunk groups.

Type:boolean
export default {
  stats: {
    chunkGroupAuxiliary: true,
  },
};

Display children of chunk groups.

Type:boolean
export default {
  stats: {
    chunkGroupChildren: true,
  },
};

Limit of assets displayed in chunk groups.

Type:number
export default {
  stats: {
    chunkGroupMaxAssets: 0,
  },
};

Display all chunk groups with the corresponding bundles.

Type:boolean
export default {
  stats: {
    chunkGroups: true,
  },
};

Add built modules information to chunk information.

Type:boolean
export default {
  stats: {
    chunkModules: true,
  },
};

Space to display chunk modules (groups will be collapsed to fit this space, value is in number of modules/group).

Type:number
export default {
  stats: {
    chunkModulesSpace: 0,
  },
};

Add the origins of chunks and chunk merging info.

Type:boolean
export default {
  stats: {
    chunkOrigins: true,
  },
};

Add information about parent, children and sibling chunks to chunk information.

Type:boolean
export default {
  stats: {
    chunkRelations: true,
  },
};

Add chunk information.

Type:boolean
export default {
  stats: {
    chunks: true,
  },
};

Sort the chunks by that field.

Type:false | string
export default {
  stats: {
    chunksSort: '...',
  },
};

Enables/Disables colorful output.

bold:string
Custom color for bold text.
cyan:string
Custom color for cyan text.
green:string
Custom color for green text.
magenta:string
Custom color for magenta text.
red:string
Custom color for red text.
yellow:string
Custom color for yellow text.
export default {
  stats: {
    colors: true,
  },
};

Context directory for request shortening.

Type:string
export default {
  stats: {
    context: '...',
  },
};

Show chunk modules that are dependencies of other modules of the chunk.

Type:boolean
export default {
  stats: {
    dependentModules: true,
  },
};

Add module depth in module graph.

Type:boolean
export default {
  stats: {
    depth: true,
  },
};

Display the entry points with the corresponding bundles.

Type:"auto" | boolean
export default {
  stats: {
    entrypoints: "auto",
  },
};

Add --env information.

Type:boolean
export default {
  stats: {
    env: true,
  },
};

Add cause to errors.

Type:"auto" | boolean
export default {
  stats: {
    errorCause: "auto",
  },
};

Add details to errors (like resolving log).

Type:"auto" | boolean
export default {
  stats: {
    errorDetails: "auto",
  },
};

Add nested errors to errors (like in AggregateError).

Type:"auto" | boolean
export default {
  stats: {
    errorErrors: "auto",
  },
};

Add internal stack trace to errors.

Type:boolean
export default {
  stats: {
    errorStack: true,
  },
};

Add errors.

Type:boolean
export default {
  stats: {
    errors: true,
  },
};

Add errors count.

Type:boolean
export default {
  stats: {
    errorsCount: true,
  },
};

Space to display errors (value is in number of lines).

Type:number
export default {
  stats: {
    errorsSpace: 0,
  },
};

Please use excludeModules instead.

Type:boolean | (RegExp | string | ModuleFilterItemTypeFn)[] | RegExp | string | ModuleFilterItemTypeFn
export default {
  stats: {
    exclude: '...',
  },
};

Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.

Type:(RegExp | string | AssetFilterItemFn)[] | RegExp | string | AssetFilterItemFn
export default {
  stats: {
    excludeAssets: '...',
  },
};

Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.

Type:boolean | (RegExp | string | ModuleFilterItemTypeFn)[] | RegExp | string | ModuleFilterItemTypeFn
export default {
  stats: {
    excludeModules: '...',
  },
};

Group assets by how their are related to chunks.

Type:boolean
export default {
  stats: {
    groupAssetsByChunk: true,
  },
};

Group assets by their status (emitted, compared for emit or cached).

Type:boolean
export default {
  stats: {
    groupAssetsByEmitStatus: true,
  },
};

Group assets by their extension.

Type:boolean
export default {
  stats: {
    groupAssetsByExtension: true,
  },
};

Group assets by their asset info (immutable, development, hotModuleReplacement, etc).

Type:boolean
export default {
  stats: {
    groupAssetsByInfo: true,
  },
};

Group assets by their path.

Type:boolean
export default {
  stats: {
    groupAssetsByPath: true,
  },
};

Group modules by their attributes (errors, warnings, assets, optional, orphan, or dependent).

Type:boolean
export default {
  stats: {
    groupModulesByAttributes: true,
  },
};

Group modules by their status (cached or built and cacheable).

Type:boolean
export default {
  stats: {
    groupModulesByCacheStatus: true,
  },
};

Group modules by their extension.

Type:boolean
export default {
  stats: {
    groupModulesByExtension: true,
  },
};

Group modules by their layer.

Type:boolean
export default {
  stats: {
    groupModulesByLayer: true,
  },
};

Group modules by their path.

Type:boolean
export default {
  stats: {
    groupModulesByPath: true,
  },
};

Group modules by their type.

Type:boolean
export default {
  stats: {
    groupModulesByType: true,
  },
};

Group reasons by their origin module.

Type:boolean
export default {
  stats: {
    groupReasonsByOrigin: true,
  },
};

Add the hash of the compilation.

Type:boolean
export default {
  stats: {
    hash: true,
  },
};

Add ids.

Type:boolean
export default {
  stats: {
    ids: true,
  },
};

Add logging output.

Type:"none" | "error" | "warn" | "info" | "log" | "verbose" | boolean
export default {
  stats: {
    logging: "none",
  },
};

Include debug logging of specified loggers (i. e. for plugins or loaders). Filters can be Strings, RegExps or Functions.

Type:boolean | (RegExp | string | FilterItemTypeFn)[] | RegExp | string | FilterItemTypeFn
export default {
  stats: {
    loggingDebug: '...',
  },
};

Add stack traces to logging output.

Type:boolean
export default {
  stats: {
    loggingTrace: true,
  },
};

Add information about assets inside modules.

Type:boolean
export default {
  stats: {
    moduleAssets: true,
  },
};

Add dependencies and origin of warnings/errors.

Type:boolean
export default {
  stats: {
    moduleTrace: true,
  },
};

Add built modules information.

Type:boolean
export default {
  stats: {
    modules: true,
  },
};

Sort the modules by that field.

Type:false | string
export default {
  stats: {
    modulesSort: '...',
  },
};

Space to display modules (groups will be collapsed to fit this space, value is in number of modules/groups).

Type:number
export default {
  stats: {
    modulesSpace: 0,
  },
};

Add information about modules nested in other modules (like with module concatenation).

Type:boolean
export default {
  stats: {
    nestedModules: true,
  },
};

Space to display modules nested within other modules (groups will be collapsed to fit this space, value is in number of modules/group).

Type:number
export default {
  stats: {
    nestedModulesSpace: 0,
  },
};

Show reasons why optimization bailed out for modules.

Type:boolean
export default {
  stats: {
    optimizationBailout: true,
  },
};

Add information about orphan modules.

Type:boolean
export default {
  stats: {
    orphanModules: true,
  },
};

Add output path information.

Type:boolean
export default {
  stats: {
    outputPath: true,
  },
};

Add performance hint flags.

Type:boolean
export default {
  stats: {
    performance: true,
  },
};

Preset for the default values.

export default {
  stats: {
    preset: '...',
  },
};

Show exports provided by modules.

Type:boolean
export default {
  stats: {
    providedExports: true,
  },
};

Add public path information.

Type:boolean
export default {
  stats: {
    publicPath: true,
  },
};

Add information about the reasons why modules are included.

Type:boolean
export default {
  stats: {
    reasons: true,
  },
};

Space to display reasons (groups will be collapsed to fit this space).

Type:number
export default {
  stats: {
    reasonsSpace: 0,
  },
};

Add information about assets that are related to other assets (like SourceMaps for assets).

Type:boolean
export default {
  stats: {
    relatedAssets: true,
  },
};
Stability: 0Deprecated

Add information about runtime modules (deprecated: use 'runtimeModules' instead).

Type:boolean
export default {
  stats: {
    runtime: true,
  },
};

Add information about runtime modules.

Type:boolean
export default {
  stats: {
    runtimeModules: true,
  },
};

Add the source code of modules.

Type:boolean
export default {
  stats: {
    source: true,
  },
};

Add timing information.

Type:boolean
export default {
  stats: {
    timings: true,
  },
};

Show exports used by modules.

Type:boolean
export default {
  stats: {
    usedExports: true,
  },
};

Add webpack version information.

Type:boolean
export default {
  stats: {
    version: true,
  },
};

Add warnings.

Type:boolean
export default {
  stats: {
    warnings: true,
  },
};

Add warnings count.

Type:boolean
export default {
  stats: {
    warningsCount: true,
  },
};

Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.

Type:(RegExp | string | WarningFilterFn)[] | RegExp | string | WarningFilterFn
export default {
  stats: {
    warningsFilter: '...',
  },
};

Space to display warnings (value is in number of lines).

Type:number
export default {
  stats: {
    warningsSpace: 0,
  },
};

Environment to build for. An array of environments to build for all of them when possible.

Type:string[] | false | string
export default {
  target: '...',
};

Enable validation of webpack configuration. Defaults to true in development mode. In production mode, defaults to true unless futureDefaults is enabled, then defaults to false.

Type:boolean
export default {
  validate: true,
};

Enter watch mode, which rebuilds on file change.

Type:boolean
export default {
  watch: true,
};

Options for the watcher.

export default {
  watchOptions: {},
};

Delay the rebuilt after the first change. Value is a time in ms.

Type:number
export default {
  watchOptions: {
    aggregateTimeout: 0,
  },
};

Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').

Type:boolean
export default {
  watchOptions: {
    followSymlinks: true,
  },
};

Ignore some files from watching (glob pattern or regexp).

Type:string[] | RegExp | string
export default {
  watchOptions: {
    ignored: '...',
  },
};

Enable polling mode for watching.

export default {
  watchOptions: {
    poll: true,
  },
};

Stop watching when stdin stream has ended.

Type:boolean
export default {
  watchOptions: {
    stdin: true,
  },
};