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" },
};

Additionally cache computation of modules that are unchanged and reference only unchanged modules. Only used when type is set to "memory".

Type:boolean
export default {
  cache: {
    type: "memory",
    cacheUnaffected: true,
  },
};

Number of generations unused cache entries stay in memory cache at minimum (1 = may be removed after unused for a single compilation, ..., Infinity: kept forever). Only used when type is set to "memory".

Type:number
export default {
  cache: {
    type: "memory",
    maxGenerations: 0,
  },
};

In memory caching.

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

Allows to collect unused memory allocated during deserialization. This requires copying data into smaller buffers and has a performance cost. Only used when type is set to "filesystem".

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

Dependencies the build depends on (in multiple categories, default categories: 'defaultWebpack'). Only used when type is set to "filesystem".

Type:object
export default {
  cache: {
    type: "filesystem",
    buildDependencies: {},
  },
};

Base directory for the cache (defaults to node_modules/.cache/webpack). Only used when type is set to "filesystem".

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

Locations for the cache (defaults to cacheDirectory / name). Only used when type is set to "filesystem".

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

Compression type used for the cache files. Only used when type is set to "filesystem".

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

Algorithm used for generation the hash (see node.js crypto package). Only used when type is set to "filesystem".

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

Time in ms after which idle period the cache storing should happen. Only used when type is set to "filesystem".

Type:number
export default {
  cache: {
    type: "filesystem",
    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). Only used when type is set to "filesystem".

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

Time in ms after which idle period the initial cache storing should happen. Only used when type is set to "filesystem".

Type:number
export default {
  cache: {
    type: "filesystem",
    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. Only used when type is set to "filesystem".

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

List of paths that are managed by a package manager and can be trusted to not be modified otherwise. Only used when type is set to "filesystem".

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

Time for which unused cache entries stay in the filesystem cache at minimum (in milliseconds). Only used when type is set to "filesystem".

Type:number
export default {
  cache: {
    type: "filesystem",
    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. Only used when type is set to "filesystem".

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

Additionally cache computation of modules that are unchanged and reference only unchanged modules in memory. Only used when type is set to "filesystem".

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

Name for the cache. Different names will lead to different coexisting caches. Only used when type is set to "filesystem".

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

Track and log detailed timing information for individual cache items. Only used when type is set to "filesystem".

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

Enable/disable readonly mode. Only used when type is set to "filesystem".

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

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

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

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. Only used when type is set to "filesystem".

Type:string
export default {
  cache: {
    type: "filesystem",
    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
export default {
  experiments: {
    buildHttp: { allowedUris: [] },
  },
};

List of allowed URIs (resp. the beginning of them).

Type:(RegExp | string | AllowedUriFn)[]
export default {
  experiments: {
    buildHttp: {
      allowedUris: [],
    },
  },
};

Location where resource content is stored for lockfile entries. It's also possible to disable storing by passing false.

Type:false | string
export default {
  experiments: {
    buildHttp: {
      cacheLocation: '...',
    },
  },
};

When set, anything that would lead to a modification of the lockfile or any resource content, will result in an error.

Type:boolean
export default {
  experiments: {
    buildHttp: {
      frozen: true,
    },
  },
};

Location of the lockfile.

Type:string
export default {
  experiments: {
    buildHttp: {
      lockfileLocation: '...',
    },
  },
};

Proxy configuration, which can be used to specify a proxy server to use for HTTP requests.

Type:string
export default {
  experiments: {
    buildHttp: {
      proxy: '...',
    },
  },
};

When set, resources of existing lockfile entries will be fetched and entries will be upgraded when resource content has changed.

Type:boolean
export default {
  experiments: {
    buildHttp: {
      upgrade: true,
    },
  },
};

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.

export default {
  experiments: {
    lazyCompilation: true,
  },
};

Specifies the backend that should be used for handling client keep alive.

client:string
A custom client.
listen:number | ListenOptions | Listen
Specifies where to listen to from the server.
protocol:"http" | "https"
Specifies the protocol the client should use to connect to the server.
server:HttpsServerOptions | HttpServerOptions | CreateServerFunction
Specifies how to create the server handling the EventSource requests.
export default {
  experiments: {
    lazyCompilation: {
      backend: {},
    },
  },
};

Enable/disable lazy compilation for entries.

Type:boolean
export default {
  experiments: {
    lazyCompilation: {
      entries: true,
    },
  },
};

Enable/disable lazy compilation for import() modules.

Type:boolean
export default {
  experiments: {
    lazyCompilation: {
      imports: true,
    },
  },
};

Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.

Type:RegExp | string | TestFn
export default {
  experiments: {
    lazyCompilation: {
      test: '...',
    },
  },
};

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.

export default {
  module: {
    generator: {},
  },
};

Generator options for asset modules.

binary:boolean
Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
dataUrl:AssetGeneratorDataUrlOptions | DataUrlFunction
The options for data url generator.
emit:boolean
Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
The filename of asset modules as relative path inside the 'output.path' directory.
Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
publicPath:string | TemplatePathFn
The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
export default {
  module: {
    generator: {
      asset: {},
    },
  },
};

No generator options are supported for this module type.

export default {
  module: {
    generator: {
      'asset/bytes': {},
    },
  },
};

Generator options for asset/inline modules.

binary:boolean
Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
dataUrl:AssetGeneratorDataUrlOptions | DataUrlFunction
The options for data url generator.
export default {
  module: {
    generator: {
      'asset/inline': {},
    },
  },
};

Generator options for asset/resource modules.

binary:boolean
Whether or not this asset module should be considered binary. This can be set to 'false' to treat this asset module as text.
emit:boolean
Emit an output asset from this asset module. This can be set to 'false' to omit emitting e. g. for SSR.
The filename of asset modules as relative path inside the 'output.path' directory.
Emit the asset in the specified folder relative to 'output.path'. This should only be needed when custom 'publicPath' is specified to match the folder structure there.
publicPath:string | TemplatePathFn
The 'publicPath' specifies the public URL address of the output files when referenced in a browser.
export default {
  module: {
    generator: {
      'asset/resource': {},
    },
  },
};

No generator options are supported for this module type.

export default {
  module: {
    generator: {
      'asset/source': {},
    },
  },
};

Generator options for css modules.

esModule:boolean
Configure the generated JS modules that use the ES modules syntax.
exportsOnly:boolean
Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
export default {
  module: {
    generator: {
      css: {},
    },
  },
};

Generator options for css/module modules.

esModule:boolean
Configure the generated JS modules that use the ES modules syntax.
exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
exportsConvention:"as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | ExportsConventionFn
Specifies the convention of exported names.
exportsOnly:boolean
Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
localIdentHashDigest:string
Digest types used for the hash.
localIdentHashDigestLength:number
Number of chars which are used for the hash.
localIdentHashFunction:string | typeof import('../lib/util/Hash')
Algorithm used for generation the hash (see node.js crypto package).
localIdentHashSalt:string
Any string which is added to the hash to salt it.
Configure the generated local ident name.
export default {
  module: {
    generator: {
      'css/auto': {},
    },
  },
};

Generator options for css/module modules.

esModule:boolean
Configure the generated JS modules that use the ES modules syntax.
exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
exportsConvention:"as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | ExportsConventionFn
Specifies the convention of exported names.
exportsOnly:boolean
Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
localIdentHashDigest:string
Digest types used for the hash.
localIdentHashDigestLength:number
Number of chars which are used for the hash.
localIdentHashFunction:string | typeof import('../lib/util/Hash')
Algorithm used for generation the hash (see node.js crypto package).
localIdentHashSalt:string
Any string which is added to the hash to salt it.
Configure the generated local ident name.
export default {
  module: {
    generator: {
      'css/global': {},
    },
  },
};

Generator options for css/module modules.

esModule:boolean
Configure the generated JS modules that use the ES modules syntax.
exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
exportsConvention:"as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | ExportsConventionFn
Specifies the convention of exported names.
exportsOnly:boolean
Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
localIdentHashDigest:string
Digest types used for the hash.
localIdentHashDigestLength:number
Number of chars which are used for the hash.
localIdentHashFunction:string | typeof import('../lib/util/Hash')
Algorithm used for generation the hash (see node.js crypto package).
localIdentHashSalt:string
Any string which is added to the hash to salt it.
Configure the generated local ident name.
export default {
  module: {
    generator: {
      'css/module': {},
    },
  },
};

Generator options for html modules.

extract:boolean
Emit the parsed and URL-rewritten HTML as a standalone .html output file alongside the module's JavaScript export. When unset, extraction defaults to true for HTML modules used as compilation entries (HTML entry points) and false for HTML modules imported from JavaScript. Filenames follow output.htmlFilename / output.htmlChunkFilename .
export default {
  module: {
    generator: {
      html: {},
    },
  },
};

No generator options are supported for this module type.

export default {
  module: {
    generator: {
      javascript: {},
    },
  },
};

No generator options are supported for this module type.

export default {
  module: {
    generator: {
      'javascript/auto': {},
    },
  },
};

No generator options are supported for this module type.

export default {
  module: {
    generator: {
      'javascript/dynamic': {},
    },
  },
};

No generator options are supported for this module type.

export default {
  module: {
    generator: {
      'javascript/esm': {},
    },
  },
};

Generator options for json modules.

JSONParse:boolean
Use JSON.parse when the JSON string is longer than 20 characters.
export default {
  module: {
    generator: {
      json: {},
    },
  },
};

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.

export default {
  module: {
    parser: {},
  },
};

Parser options for asset modules.

dataUrlCondition:AssetParserDataUrlOptions | AssetParserDataUrlFunction
The condition for inlining the asset as DataUrl.
export default {
  module: {
    parser: {
      asset: {},
    },
  },
};

No parser options are supported for this module type.

export default {
  module: {
    parser: {
      'asset/bytes': {},
    },
  },
};

No parser options are supported for this module type.

export default {
  module: {
    parser: {
      'asset/inline': {},
    },
  },
};

No parser options are supported for this module type.

export default {
  module: {
    parser: {
      'asset/resource': {},
    },
  },
};

No parser options are supported for this module type.

export default {
  module: {
    parser: {
      'asset/source': {},
    },
  },
};

Parser options for css modules.

exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
import:boolean
Enable/disable @import at-rules handling.
namedExports:boolean
Use ES modules named export for css exports.
Enable/disable url() / image-set() / src() / image() functions handling.
export default {
  module: {
    parser: {
      css: {},
    },
  },
};

Parser options for css/auto and css/module modules.

animation:boolean
Enable/disable renaming of @keyframes .
container:boolean
Enable/disable renaming of @container names.
customIdents:boolean
Enable/disable renaming of custom identifiers.
dashedIdents:boolean
Enable/disable renaming of dashed identifiers, e. g. custom properties.
exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
function:boolean
Enable/disable renaming of @function names.
grid:boolean
Enable/disable renaming of grid identifiers.
import:boolean
Enable/disable @import at-rules handling.
namedExports:boolean
Use ES modules named export for css exports.
pure:boolean
Enable strict pure mode: every selector must contain at least one local class or id selector.
Enable/disable url() / image-set() / src() / image() functions handling.
export default {
  module: {
    parser: {
      'css/auto': {},
    },
  },
};

Parser options for css/global modules.

animation:boolean
Enable/disable renaming of @keyframes .
container:boolean
Enable/disable renaming of @container names.
customIdents:boolean
Enable/disable renaming of custom identifiers.
dashedIdents:boolean
Enable/disable renaming of dashed identifiers, e. g. custom properties.
exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
function:boolean
Enable/disable renaming of @function names.
grid:boolean
Enable/disable renaming of grid identifiers.
import:boolean
Enable/disable @import at-rules handling.
namedExports:boolean
Use ES modules named export for css exports.
Enable/disable url() / image-set() / src() / image() functions handling.
export default {
  module: {
    parser: {
      'css/global': {},
    },
  },
};

Parser options for css/auto and css/module modules.

animation:boolean
Enable/disable renaming of @keyframes .
container:boolean
Enable/disable renaming of @container names.
customIdents:boolean
Enable/disable renaming of custom identifiers.
dashedIdents:boolean
Enable/disable renaming of dashed identifiers, e. g. custom properties.
exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
function:boolean
Enable/disable renaming of @function names.
grid:boolean
Enable/disable renaming of grid identifiers.
import:boolean
Enable/disable @import at-rules handling.
namedExports:boolean
Use ES modules named export for css exports.
pure:boolean
Enable strict pure mode: every selector must contain at least one local class or id selector.
Enable/disable url() / image-set() / src() / image() functions handling.
export default {
  module: {
    parser: {
      'css/module': {},
    },
  },
};

Parser options for javascript modules.

amd:false | object
Set the value of require.amd and define.amd . Or disable AMD support.
anonymousDefaultExportName:boolean
Set .name to "default" for anonymous default export functions and classes per ES spec. Disable to reduce output size when .name is not needed.
browserify:boolean
Enable/disable special handling for browserify bundles.
commonjs:boolean
Enable/disable parsing of CommonJs syntax.
commonjsMagicComments:boolean
Enable/disable parsing of magic comments in CommonJs syntax.
createRequire:boolean | string
Enable/disable parsing "import createRequire from "module"" and evaluating createRequire().
deferImport:boolean
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.
dynamicImportFetchPriority:"low" | "high" | "auto" | false
Specifies global fetchPriority for dynamic import.
dynamicImportMode:"eager" | "weak" | "lazy" | "lazy-once"
Specifies global mode for dynamic import.
dynamicImportPrefetch:number | boolean
Specifies global prefetch for dynamic import.
dynamicImportPreload:number | boolean
Specifies global preload for dynamic import.
dynamicUrl:boolean
Enable/disable parsing of dynamic URL.
exportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
exprContextCritical:boolean
Enable warnings for full dynamic dependencies.
exprContextRecursive:boolean
Enable recursive directory lookup for full dynamic dependencies.
exprContextRegExp:RegExp | boolean
Sets the default regular expression for full dynamic dependencies.
exprContextRequest:string
Set the default request for full dynamic dependencies.
harmony:boolean
Enable/disable parsing of EcmaScript Modules syntax.
import:boolean
Enable/disable parsing of import() syntax.
importExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ...".
importMeta:boolean | "preserve-unknown"
Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
importMetaContext:boolean
Enable/disable evaluating import.meta.webpackContext.
node:false | NodeOptions
Include polyfills or mocks for various node stuff.
overrideStrict:"strict" | "non-strict"
Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
parse:ParseFunction
Function to parser source code.
reexportExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
requireContext:boolean
Enable/disable parsing of require.context syntax.
requireEnsure:boolean
Enable/disable parsing of require.ensure syntax.
requireInclude:boolean
Enable/disable parsing of require.include syntax.
requireJs:boolean
Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
sourceImport:boolean
Enable experimental tc39 proposal https://github.com/tc39/proposal-source-phase-imports . This allows importing modules at source phase.
strictExportPresence:boolean
Deprecated. Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
strictThisContextOnImports:boolean
Handle the this context correctly according to the spec for namespace objects.
system:boolean
Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
typescript:boolean
Enable typescript support.
unknownContextCritical:boolean
Enable warnings when using the require function in a not statically analyse-able way.
unknownContextRecursive:boolean
Enable recursive directory lookup when using the require function in a not statically analyse-able way.
unknownContextRegExp:RegExp | boolean
Sets the regular expression when using the require function in a not statically analyse-able way.
unknownContextRequest:string
Sets the request when using the require function in a not statically analyse-able way.
url:"relative" | boolean
Enable/disable parsing of new URL() syntax.
worker:string[] | boolean
Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
wrappedContextCritical:boolean
Enable warnings for partial dynamic dependencies.
wrappedContextRecursive:boolean
Enable recursive directory lookup for partial dynamic dependencies.
wrappedContextRegExp:RegExp
Set the inner regular expression for partial dynamic dependencies.
export default {
  module: {
    parser: {
      javascript: {},
    },
  },
};

Parser options for javascript modules.

amd:false | object
Set the value of require.amd and define.amd . Or disable AMD support.
anonymousDefaultExportName:boolean
Set .name to "default" for anonymous default export functions and classes per ES spec. Disable to reduce output size when .name is not needed.
browserify:boolean
Enable/disable special handling for browserify bundles.
commonjs:boolean
Enable/disable parsing of CommonJs syntax.
commonjsMagicComments:boolean
Enable/disable parsing of magic comments in CommonJs syntax.
createRequire:boolean | string
Enable/disable parsing "import createRequire from "module"" and evaluating createRequire().
deferImport:boolean
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.
dynamicImportFetchPriority:"low" | "high" | "auto" | false
Specifies global fetchPriority for dynamic import.
dynamicImportMode:"eager" | "weak" | "lazy" | "lazy-once"
Specifies global mode for dynamic import.
dynamicImportPrefetch:number | boolean
Specifies global prefetch for dynamic import.
dynamicImportPreload:number | boolean
Specifies global preload for dynamic import.
dynamicUrl:boolean
Enable/disable parsing of dynamic URL.
exportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
exprContextCritical:boolean
Enable warnings for full dynamic dependencies.
exprContextRecursive:boolean
Enable recursive directory lookup for full dynamic dependencies.
exprContextRegExp:RegExp | boolean
Sets the default regular expression for full dynamic dependencies.
exprContextRequest:string
Set the default request for full dynamic dependencies.
harmony:boolean
Enable/disable parsing of EcmaScript Modules syntax.
import:boolean
Enable/disable parsing of import() syntax.
importExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ...".
importMeta:boolean | "preserve-unknown"
Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
importMetaContext:boolean
Enable/disable evaluating import.meta.webpackContext.
node:false | NodeOptions
Include polyfills or mocks for various node stuff.
overrideStrict:"strict" | "non-strict"
Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
parse:ParseFunction
Function to parser source code.
reexportExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
requireContext:boolean
Enable/disable parsing of require.context syntax.
requireEnsure:boolean
Enable/disable parsing of require.ensure syntax.
requireInclude:boolean
Enable/disable parsing of require.include syntax.
requireJs:boolean
Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
sourceImport:boolean
Enable experimental tc39 proposal https://github.com/tc39/proposal-source-phase-imports . This allows importing modules at source phase.
strictExportPresence:boolean
Deprecated. Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
strictThisContextOnImports:boolean
Handle the this context correctly according to the spec for namespace objects.
system:boolean
Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
typescript:boolean
Enable typescript support.
unknownContextCritical:boolean
Enable warnings when using the require function in a not statically analyse-able way.
unknownContextRecursive:boolean
Enable recursive directory lookup when using the require function in a not statically analyse-able way.
unknownContextRegExp:RegExp | boolean
Sets the regular expression when using the require function in a not statically analyse-able way.
unknownContextRequest:string
Sets the request when using the require function in a not statically analyse-able way.
url:"relative" | boolean
Enable/disable parsing of new URL() syntax.
worker:string[] | boolean
Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
wrappedContextCritical:boolean
Enable warnings for partial dynamic dependencies.
wrappedContextRecursive:boolean
Enable recursive directory lookup for partial dynamic dependencies.
wrappedContextRegExp:RegExp
Set the inner regular expression for partial dynamic dependencies.
export default {
  module: {
    parser: {
      'javascript/auto': {},
    },
  },
};

Parser options for javascript modules.

amd:false | object
Set the value of require.amd and define.amd . Or disable AMD support.
anonymousDefaultExportName:boolean
Set .name to "default" for anonymous default export functions and classes per ES spec. Disable to reduce output size when .name is not needed.
browserify:boolean
Enable/disable special handling for browserify bundles.
commonjs:boolean
Enable/disable parsing of CommonJs syntax.
commonjsMagicComments:boolean
Enable/disable parsing of magic comments in CommonJs syntax.
createRequire:boolean | string
Enable/disable parsing "import createRequire from "module"" and evaluating createRequire().
deferImport:boolean
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.
dynamicImportFetchPriority:"low" | "high" | "auto" | false
Specifies global fetchPriority for dynamic import.
dynamicImportMode:"eager" | "weak" | "lazy" | "lazy-once"
Specifies global mode for dynamic import.
dynamicImportPrefetch:number | boolean
Specifies global prefetch for dynamic import.
dynamicImportPreload:number | boolean
Specifies global preload for dynamic import.
dynamicUrl:boolean
Enable/disable parsing of dynamic URL.
exportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
exprContextCritical:boolean
Enable warnings for full dynamic dependencies.
exprContextRecursive:boolean
Enable recursive directory lookup for full dynamic dependencies.
exprContextRegExp:RegExp | boolean
Sets the default regular expression for full dynamic dependencies.
exprContextRequest:string
Set the default request for full dynamic dependencies.
harmony:boolean
Enable/disable parsing of EcmaScript Modules syntax.
import:boolean
Enable/disable parsing of import() syntax.
importExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ...".
importMeta:boolean | "preserve-unknown"
Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
importMetaContext:boolean
Enable/disable evaluating import.meta.webpackContext.
node:false | NodeOptions
Include polyfills or mocks for various node stuff.
overrideStrict:"strict" | "non-strict"
Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
parse:ParseFunction
Function to parser source code.
reexportExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
requireContext:boolean
Enable/disable parsing of require.context syntax.
requireEnsure:boolean
Enable/disable parsing of require.ensure syntax.
requireInclude:boolean
Enable/disable parsing of require.include syntax.
requireJs:boolean
Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
sourceImport:boolean
Enable experimental tc39 proposal https://github.com/tc39/proposal-source-phase-imports . This allows importing modules at source phase.
strictExportPresence:boolean
Deprecated. Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
strictThisContextOnImports:boolean
Handle the this context correctly according to the spec for namespace objects.
system:boolean
Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
typescript:boolean
Enable typescript support.
unknownContextCritical:boolean
Enable warnings when using the require function in a not statically analyse-able way.
unknownContextRecursive:boolean
Enable recursive directory lookup when using the require function in a not statically analyse-able way.
unknownContextRegExp:RegExp | boolean
Sets the regular expression when using the require function in a not statically analyse-able way.
unknownContextRequest:string
Sets the request when using the require function in a not statically analyse-able way.
url:"relative" | boolean
Enable/disable parsing of new URL() syntax.
worker:string[] | boolean
Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
wrappedContextCritical:boolean
Enable warnings for partial dynamic dependencies.
wrappedContextRecursive:boolean
Enable recursive directory lookup for partial dynamic dependencies.
wrappedContextRegExp:RegExp
Set the inner regular expression for partial dynamic dependencies.
export default {
  module: {
    parser: {
      'javascript/dynamic': {},
    },
  },
};

Parser options for javascript modules.

amd:false | object
Set the value of require.amd and define.amd . Or disable AMD support.
anonymousDefaultExportName:boolean
Set .name to "default" for anonymous default export functions and classes per ES spec. Disable to reduce output size when .name is not needed.
browserify:boolean
Enable/disable special handling for browserify bundles.
commonjs:boolean
Enable/disable parsing of CommonJs syntax.
commonjsMagicComments:boolean
Enable/disable parsing of magic comments in CommonJs syntax.
createRequire:boolean | string
Enable/disable parsing "import createRequire from "module"" and evaluating createRequire().
deferImport:boolean
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.
dynamicImportFetchPriority:"low" | "high" | "auto" | false
Specifies global fetchPriority for dynamic import.
dynamicImportMode:"eager" | "weak" | "lazy" | "lazy-once"
Specifies global mode for dynamic import.
dynamicImportPrefetch:number | boolean
Specifies global prefetch for dynamic import.
dynamicImportPreload:number | boolean
Specifies global preload for dynamic import.
dynamicUrl:boolean
Enable/disable parsing of dynamic URL.
exportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
exprContextCritical:boolean
Enable warnings for full dynamic dependencies.
exprContextRecursive:boolean
Enable recursive directory lookup for full dynamic dependencies.
exprContextRegExp:RegExp | boolean
Sets the default regular expression for full dynamic dependencies.
exprContextRequest:string
Set the default request for full dynamic dependencies.
harmony:boolean
Enable/disable parsing of EcmaScript Modules syntax.
import:boolean
Enable/disable parsing of import() syntax.
importExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "import ... from ...".
importMeta:boolean | "preserve-unknown"
Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
importMetaContext:boolean
Enable/disable evaluating import.meta.webpackContext.
node:false | NodeOptions
Include polyfills or mocks for various node stuff.
overrideStrict:"strict" | "non-strict"
Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
parse:ParseFunction
Function to parser source code.
reexportExportsPresence:"error" | "warn" | "auto" | false
Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
requireContext:boolean
Enable/disable parsing of require.context syntax.
requireEnsure:boolean
Enable/disable parsing of require.ensure syntax.
requireInclude:boolean
Enable/disable parsing of require.include syntax.
requireJs:boolean
Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
sourceImport:boolean
Enable experimental tc39 proposal https://github.com/tc39/proposal-source-phase-imports . This allows importing modules at source phase.
strictExportPresence:boolean
Deprecated. Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
strictThisContextOnImports:boolean
Handle the this context correctly according to the spec for namespace objects.
system:boolean
Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
typescript:boolean
Enable typescript support.
unknownContextCritical:boolean
Enable warnings when using the require function in a not statically analyse-able way.
unknownContextRecursive:boolean
Enable recursive directory lookup when using the require function in a not statically analyse-able way.
unknownContextRegExp:RegExp | boolean
Sets the regular expression when using the require function in a not statically analyse-able way.
unknownContextRequest:string
Sets the request when using the require function in a not statically analyse-able way.
url:"relative" | boolean
Enable/disable parsing of new URL() syntax.
worker:string[] | boolean
Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
wrappedContextCritical:boolean
Enable warnings for partial dynamic dependencies.
wrappedContextRecursive:boolean
Enable recursive directory lookup for partial dynamic dependencies.
wrappedContextRegExp:RegExp
Set the inner regular expression for partial dynamic dependencies.
export default {
  module: {
    parser: {
      'javascript/esm': {},
    },
  },
};

Parser options for JSON modules.

exportsDepth:number
The depth of json dependency flagged as exportInfo .
namedExports:boolean
Allow named exports for json of object type.
parse:ParseFn
Function to parser content and return JSON.
export default {
  module: {
    parser: {
      json: {},
    },
  },
};

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
export default {
  optimization: {
    runtimeChunk: "single",
  },
};

The name or name factory for the runtime chunks.

Type:string | RuntimeChunkFunction
export default {
  optimization: {
    runtimeChunk: {
      name: '...',
    },
  },
};

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.

export default {
  optimization: {
    splitChunks: false,
  },
};

Sets the name delimiter for created chunks.

Type:string
export default {
  optimization: {
    splitChunks: {
      automaticNameDelimiter: '...',
    },
  },
};

Assign modules to a cache group (modules from different cache groups are tried to keep in separate chunks, default categories: 'default', 'defaultVendors').

Type:object
export default {
  optimization: {
    splitChunks: {
      cacheGroups: {},
    },
  },
};

Select chunks for determining shared modules (defaults to "async", "initial" and "all" requires adding these chunks to the HTML).

Type:"initial" | "async" | "all" | RegExp | ChunkFilterFn
export default {
  optimization: {
    splitChunks: {
      chunks: "initial",
    },
  },
};

Sets the size types which are used when a number is used for sizes.

Type:SourceType[]
export default {
  optimization: {
    splitChunks: {
      defaultSizeTypes: [],
    },
  },
};

Size threshold at which splitting is enforced and other restrictions (minRemainingSize, maxAsyncRequests, maxInitialRequests) are ignored.

Type:number | object
export default {
  optimization: {
    splitChunks: {
      enforceSizeThreshold: 0,
    },
  },
};

Options for modules not selected by any other cache group.

Type:object
automaticNameDelimiter:string
Sets the name delimiter for created chunks.
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).
maxAsyncSize:number | object
Maximal size hint for the on-demand chunks.
maxInitialSize:number | object
Maximal size hint for the initial chunks.
maxSize:number | object
Maximal size hint for the created chunks.
minSize:number | object
Minimal size for the created chunk.
minSizeReduction:number | object
Minimum size reduction due to the created chunk.
export default {
  optimization: {
    splitChunks: {
      fallbackCacheGroup: {},
    },
  },
};

Sets the template for the filename for created chunks.

export default {
  optimization: {
    splitChunks: {
      filename: '...',
    },
  },
};

Prevents exposing path info when creating names for parts splitted by maxSize.

Type:boolean
export default {
  optimization: {
    splitChunks: {
      hidePathInfo: true,
    },
  },
};

Maximum number of requests which are accepted for on-demand loading.

Type:number
export default {
  optimization: {
    splitChunks: {
      maxAsyncRequests: 0,
    },
  },
};

Maximal size hint for the on-demand chunks.

Type:number | object
export default {
  optimization: {
    splitChunks: {
      maxAsyncSize: 0,
    },
  },
};

Maximum number of initial chunks which are accepted for an entry point.

Type:number
export default {
  optimization: {
    splitChunks: {
      maxInitialRequests: 0,
    },
  },
};

Maximal size hint for the initial chunks.

Type:number | object
export default {
  optimization: {
    splitChunks: {
      maxInitialSize: 0,
    },
  },
};

Maximal size hint for the created chunks.

Type:number | object
export default {
  optimization: {
    splitChunks: {
      maxSize: 0,
    },
  },
};

Minimum number of times a module has to be duplicated until it's considered for splitting.

Type:number
export default {
  optimization: {
    splitChunks: {
      minChunks: 0,
    },
  },
};

Minimal size for the chunks the stay after moving the modules to a new chunk.

Type:number | object
export default {
  optimization: {
    splitChunks: {
      minRemainingSize: 0,
    },
  },
};

Minimal size for the created chunks.

Type:number | object
export default {
  optimization: {
    splitChunks: {
      minSize: 0,
    },
  },
};

Minimum size reduction due to the created chunk.

Type:number | object
export default {
  optimization: {
    splitChunks: {
      minSizeReduction: 0,
    },
  },
};

Give chunks created a name (chunks with equal name are merged).

Type:false | string | GetNameFn
export default {
  optimization: {
    splitChunks: {
      name: '...',
    },
  },
};

Compare used exports when checking common modules. Modules will only be put in the same chunk when exports are equal.

Type:boolean
export default {
  optimization: {
    splitChunks: {
      usedExports: true,
    },
  },
};

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,
  },
};
export default {
  output: {
    auxiliaryComment: '...',
  },
};

Set comment for amd section in UMD.

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

Set comment for commonjs (exports) section in UMD.

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

Set comment for commonjs2 (module.exports) section in UMD.

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

Set comment for root (global variable) section in UMD.

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

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.

export default {
  output: {
    clean: true,
  },
};

Log the assets that should be removed instead of deleting them.

Type:boolean
export default {
  output: {
    clean: {
      dry: true,
    },
  },
};

Keep these assets.

Type:RegExp | string | KeepFn
export default {
  output: {
    clean: {
      keep: '...',
    },
  },
};

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.

export default {
  output: {
    environment: {},
  },
};

The environment supports arrow functions ('() => ...').

Type:boolean
export default {
  output: {
    environment: {
      arrowFunction: true,
    },
  },
};

The environment supports async function and await ('async function () await ...').

Type:boolean
export default {
  output: {
    environment: {
      asyncFunction: true,
    },
  },
};

The environment supports BigInt as literal (123n).

Type:boolean
export default {
  output: {
    environment: {
      bigIntLiteral: true,
    },
  },
};

The environment supports const and let for variable declarations.

Type:boolean
export default {
  output: {
    environment: {
      const: true,
    },
  },
};

The environment supports destructuring ('a, b = obj').

Type:boolean
export default {
  output: {
    environment: {
      destructuring: true,
    },
  },
};

The environment supports 'document'.

Type:boolean
export default {
  output: {
    environment: {
      document: true,
    },
  },
};

The environment supports an async import() function to import EcmaScript modules.

Type:boolean
export default {
  output: {
    environment: {
      dynamicImport: true,
    },
  },
};

The environment supports an async import() is available when creating a worker.

Type:boolean
export default {
  output: {
    environment: {
      dynamicImportInWorker: true,
    },
  },
};

The environment supports 'for of' iteration ('for (const x of array) ...').

Type:boolean
export default {
  output: {
    environment: {
      forOf: true,
    },
  },
};

The environment supports 'globalThis'.

Type:boolean
export default {
  output: {
    environment: {
      globalThis: true,
    },
  },
};

The environment supports import.meta.dirname and import.meta.filename.

Type:boolean
export default {
  output: {
    environment: {
      importMetaDirnameAndFilename: true,
    },
  },
};

The environment supports object method shorthand ('module() {}').

Type:boolean
export default {
  output: {
    environment: {
      methodShorthand: true,
    },
  },
};

The environment supports EcmaScript Module syntax to import EcmaScript modules (import ... from '...').

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

The environment supports node: prefix for Node.js core modules.

Type:boolean
export default {
  output: {
    environment: {
      nodePrefixForCoreModules: true,
    },
  },
};

The environment supports optional chaining ('obj?.a' or 'obj?.()').

Type:boolean
export default {
  output: {
    environment: {
      optionalChaining: true,
    },
  },
};

The environment supports template literals.

Type:boolean
export default {
  output: {
    environment: {
      templateLiteral: true,
    },
  },
};

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.

export default {
  output: {
    library: { type: "var" },
  },
};

Name of the exposed AMD library in the UMD.

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

Name of the exposed commonjs export in the UMD.

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

Name of the property exposed globally by a UMD library.

Type:string[] | string
export default {
  output: {
    library: {
      root: '...',
    },
  },
};

Add a container for define/require functions in the AMD module.

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

Add a comment in the UMD wrapper.

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: {
    library: {
      auxiliaryComment: '...',
    },
  },
};

Specify which export should be exposed as library.

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

The name of the library (some types allow unnamed libraries too).

amd:string
Name of the exposed AMD library in the UMD.
commonjs:string
Name of the exposed commonjs export in the UMD.
root:string[] | string
Name of the property exposed globally by a UMD library.
export default {
  output: {
    library: {
      name: '...',
    },
  },
};

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).

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: {
    library: {
      type: "var",
    },
  },
};

If output.libraryTarget is set to umd and output.library is set, setting this to true will name the AMD module.

Type:boolean
export default {
  output: {
    library: {
      umdNamedDefine: true,
    },
  },
};
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
export default {
  output: {
    trustedTypes: '...',
  },
};

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'.

Type:"continue" | "stop"
export default {
  output: {
    trustedTypes: {
      onPolicyCreationFailure: "continue",
    },
  },
};

The name of the Trusted Types policy created by webpack to serve bundle chunks.

Type:string
export default {
  output: {
    trustedTypes: {
      policyName: '...',
    },
  },
};
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.

export default {
  resolve: {
    tsconfig: '...',
  },
};

A path to the tsconfig file.

Type:string
export default {
  resolve: {
    tsconfig: {
      configFile: '...',
    },
  },
};

References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths.

Type:"auto" | string
export default {
  resolve: {
    tsconfig: {
      references: "auto",
    },
  },
};

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.

export default {
  resolveLoader: {
    tsconfig: '...',
  },
};

A path to the tsconfig file.

Type:string
export default {
  resolveLoader: {
    tsconfig: {
      configFile: '...',
    },
  },
};

References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths.

Type:"auto" | string
export default {
  resolveLoader: {
    tsconfig: {
      references: "auto",
    },
  },
};

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
export default {
  snapshot: {
    buildDependencies: {},
  },
};

Use hashes of the content of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    buildDependencies: {
      hash: true,
    },
  },
};

Use timestamps of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    buildDependencies: {
      timestamp: true,
    },
  },
};

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

Type:object
export default {
  snapshot: {
    contextModule: {},
  },
};

Use hashes of the content of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    contextModule: {
      hash: true,
    },
  },
};

Use timestamps of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    contextModule: {
      timestamp: true,
    },
  },
};

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
export default {
  snapshot: {
    module: {},
  },
};

Use hashes of the content of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    module: {
      hash: true,
    },
  },
};

Use timestamps of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    module: {
      timestamp: true,
    },
  },
};

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

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

Use hashes of the content of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    resolve: {
      hash: true,
    },
  },
};

Use timestamps of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    resolve: {
      timestamp: true,
    },
  },
};

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

Type:object
export default {
  snapshot: {
    resolveBuildDependencies: {},
  },
};

Use hashes of the content of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    resolveBuildDependencies: {
      hash: true,
    },
  },
};

Use timestamps of the files/directories to determine invalidation.

Type:boolean
export default {
  snapshot: {
    resolveBuildDependencies: {
      timestamp: true,
    },
  },
};

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
export default {
  stats: {
    children: "none",
  },
};

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

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

Add assets information.

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

Sort the assets by that field.

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

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

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

Add built at time information.

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

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

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

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

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

Add information about cached (not built) modules.

Type:boolean
export default {
  stats: {
    children: {
      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: {
      children: "none",
    },
  },
};

Display auxiliary assets in chunk groups.

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

Display children of chunk groups.

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

Limit of assets displayed in chunk groups.

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

Display all chunk groups with the corresponding bundles.

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

Add built modules information to chunk information.

Type:boolean
export default {
  stats: {
    children: {
      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: {
    children: {
      chunkModulesSpace: 0,
    },
  },
};

Add the origins of chunks and chunk merging info.

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

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

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

Add chunk information.

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

Sort the chunks by that field.

Type:false | string
export default {
  stats: {
    children: {
      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: {
    children: {
      colors: true,
    },
  },
};

Context directory for request shortening.

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

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

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

Add module depth in module graph.

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

Display the entry points with the corresponding bundles.

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

Add --env information.

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

Add cause to errors.

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

Add details to errors (like resolving log).

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

Add nested errors to errors (like in AggregateError).

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

Add internal stack trace to errors.

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

Add errors.

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

Add errors count.

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

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

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

Please use excludeModules instead.

Type:boolean | (RegExp | string | ModuleFilterItemTypeFn)[] | RegExp | string | ModuleFilterItemTypeFn
export default {
  stats: {
    children: {
      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: {
    children: {
      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: {
    children: {
      excludeModules: '...',
    },
  },
};

Group assets by how their are related to chunks.

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

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

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

Group assets by their extension.

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

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

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

Group assets by their path.

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

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

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

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

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

Group modules by their extension.

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

Group modules by their layer.

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

Group modules by their path.

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

Group modules by their type.

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

Group reasons by their origin module.

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

Add the hash of the compilation.

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

Add ids.

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

Add logging output.

Type:"none" | "error" | "warn" | "info" | "log" | "verbose" | boolean
export default {
  stats: {
    children: {
      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: {
    children: {
      loggingDebug: '...',
    },
  },
};

Add stack traces to logging output.

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

Add information about assets inside modules.

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

Add dependencies and origin of warnings/errors.

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

Add built modules information.

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

Sort the modules by that field.

Type:false | string
export default {
  stats: {
    children: {
      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: {
    children: {
      modulesSpace: 0,
    },
  },
};

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

Type:boolean
export default {
  stats: {
    children: {
      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: {
    children: {
      nestedModulesSpace: 0,
    },
  },
};

Show reasons why optimization bailed out for modules.

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

Add information about orphan modules.

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

Add output path information.

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

Add performance hint flags.

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

Preset for the default values.

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

Show exports provided by modules.

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

Add public path information.

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

Add information about the reasons why modules are included.

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

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

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

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

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

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

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

Add information about runtime modules.

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

Add the source code of modules.

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

Add timing information.

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

Show exports used by modules.

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

Add webpack version information.

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

Add warnings.

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

Add warnings count.

Type:boolean
export default {
  stats: {
    children: {
      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: {
    children: {
      warningsFilter: '...',
    },
  },
};

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

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

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.

export default {
  stats: {
    colors: true,
  },
};

Custom color for bold text.

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

Custom color for cyan text.

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

Custom color for green text.

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

Custom color for magenta text.

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

Custom color for red text.

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

Custom color for yellow text.

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

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,
  },
};