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>

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

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

Type:

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

References to other configurations to depend on.

[]

Options for the webpack-dev-server.

Type:
<false> | <object>

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

[] | <false> | <"eval"> | <string>

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

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

Type:
<false> | <string>

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

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

[]

The entry point(s) of the compilation.

Type:
<RawEntryDynamic> | <EntryObject> | <string> [] | <string>

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

Support WebAssembly as asynchronous EcmaScript Module.

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

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

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

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

Enable css support.

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.

Apply defaults of next major version.

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

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

backend:
<BackEnd> | <LazyCompilationDefaultBackendOptions> - Specifies the backend that should be used for handling client keep alive.
entries:<boolean>
Enable/disable lazy compilation for entries.
imports:<boolean>
Enable/disable lazy compilation for import() modules.
test:<RegExp> | <string> | <TestFn>
Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.

Allow output javascript files as module source type.

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

Support WebAssembly as synchronous EcmaScript Module (outdated).

Enable typescript support.

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

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.

Type:
<(RegExp | string | object | ExternalItemFunctionCallback | ExternalItemFunctionPromise)[]> | <RegExp> | <string> | <object> | <ExternalItemFunctionCallback> | <ExternalItemFunctionPromise>

Specify externals depending on the layer.

Type:<object> | <ExternalItemByLayerFn>

Enable presets of externals for specific targets.

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.

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

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.

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.

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

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

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

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

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">

Ignore specific warnings.

Type:
{(RegExp | object | IgnoreFn)[]}

Options for infrastructure level logging.

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.

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

Custom console used for logging.

Enable debug logging for specific loggers.

Type:<boolean> | <(RegExp | string | FilterItemTypeFn)[]> | <RegExp> | <string> | <FilterItemTypeFn>

Log level.

Type:
<"none"> | <"error"> | <"warn"> | <"info"> | <"log"> | <"verbose">

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

Custom values available in the loader context.

Enable production optimizations or development hints.

Type:
<"development"> | <"production"> | <"none">

Options affecting the normal modules (NormalModuleFactory).

An array of rules applied by default for modules.

Type:
[ <("..." | false | 0 | '' | null | undefined | RuleSetRule)> ]((".html#--false--0----null--undefined--rulesetrule)[]

Enable warnings for full dynamic dependencies.

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

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

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

Specify options for each generator.

Generator options for asset modules.
No generator options are supported for this module type.
Generator options for asset/inline modules.
Generator options for asset/resource modules.
No generator options are supported for this module type.
Generator options for css modules.
Generator options for css/module modules.
Generator options for css/module modules.
Generator options for css/module modules.
Generator options for html modules.
No generator options are supported for this module type.
javascript/auto:<EmptyGeneratorOptions>
No generator options are supported for this module type.
javascript/dynamic:<EmptyGeneratorOptions>
No generator options are supported for this module type.
No generator options are supported for this module type.
Generator options for json modules.

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

Type:
<(RegExp | string | NoParseFn)[]> | <RegExp> | <string> | <NoParseFn>

Specify options for each parser.

Parser options for asset modules.
No parser options are supported for this module type.
No parser options are supported for this module type.
asset/resource:<EmptyParserOptions>
No parser options are supported for this module type.
No parser options are supported for this module type.
Parser options for css modules.
Parser options for css/auto and css/module modules.
Parser options for css/global modules.
Parser options for css/auto and css/module modules.
Parser options for javascript modules.
Parser options for javascript modules.
javascript/dynamic:<JavascriptParserOptions>
Parser options for javascript modules.
Parser options for javascript modules.
Parser options for JSON modules.

An array of rules applied for modules.

Type:
[ <("..." | false | 0 | '' | null | undefined | RuleSetRule)> ]((".html#--false--0----null--undefined--rulesetrule)[]

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

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

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

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

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

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

Cache the resolving of module requests.

Type:<boolean> | <UnsafeCachePredicate>

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

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

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

Name of the configuration. Used when loading multiple configurations.

Include polyfills or mocks for various node stuff.

Type:
<false> | <NodeOptions>

Include a polyfill for the '__dirname' variable.

Type:
<false> | <true> | <"warn-mock"> | <"mock"> | <"node-module"> | <"eval-only">

Include a polyfill for the '__filename' variable.

Type:
<false> | <true> | <"warn-mock"> | <"mock"> | <"node-module"> | <"eval-only">

Include a polyfill for the 'global' variable.

Type:
<false> | <true> | <"warn">

Enables/Disables integrated optimizations.

Avoid wrapping the entry module in an IIFE.

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

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>

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

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

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

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

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>

Reduce size of WASM by changing imports to shorter strings.

Merge chunks which contain the same modules.

Enable minimizing the output. Uses optimization.minimizer.

Minimizer(s) to use for minimizing the output.

Type:
[ <("..." | false | 0 | '' | null | undefined | WebpackPluginInstance | WebpackPluginFunction)> ]((".html#--false--0----null--undefined--webpackplugininstance--webpackpluginfunction)[]

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>

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

Set process.env.NODE_ENV to a specific value.

Type:
<false> | <string>

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

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

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

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

Remove chunks which are empty.

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

Type:
<"single"> | <"multiple"> | <boolean> | <object>
name:<string> | <RuntimeChunkFunction>
The name or name factory for the runtime chunks.

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>

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

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

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>

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

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

Type:
{string | TemplatePathFn }

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

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.
Set comment for  root (global variable) section in UMD.

Add charset attribute for script tag.

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.

Type:
{string | TemplatePathFn }

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>

Number of milliseconds before chunk request expires.

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>

The global variable used by webpack for loading of chunks.

Clean the output directory before emit.

Log the assets that should be removed instead of deleting them.
keep:<RegExp> | <string> | <KeepFn>
Keep these assets.

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

This option enables cross-origin loading of chunks.

Type:
<false> | <"anonymous"> | <"use-credentials">

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.

Type:
{string | TemplatePathFn }

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.

Type:
{string | TemplatePathFn }

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

Type:<string> | <ModuleFilenameTemplateFunction>

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

Type:<string> | <ModuleFilenameTemplateFunction>

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.

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

Type:
{("jsonp" | "import-scripts" | "require" | "async-node" | "import" | string)[]}

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)[]}

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

Type:
{("fetch" | "async-node" | string)[]}

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

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

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.

Type:
{string | TemplatePathFn }

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

Digest types used for the hash.

Number of chars which are used for the hash.

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

| [ <typeof import('../lib/util/Hash')> ](typeof import('.html#typeof-importlibutilhash)

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

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

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

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

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.

Type:
{string | TemplatePathFn }

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.

Type:
{string | TemplatePathFn }

Ignore warnings in the browser.

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

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

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

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

Type:
<"var"> | <"module"> | <"assign"> | <"assign-properties"> | <"this"> | <"window"> | <"self"> | <"global"> | <"commonjs"> | <"commonjs2"> | <"commonjs-module"> | <"commonjs-static"> | <"amd"> | <"amd-require"> | <"umd"> | <"umd2"> | <"jsonp"> | <"system"> | <string>

Output javascript files as module source type.

The output directory as absolute path (required).

Include comments with information about the modules.

Type:
<"verbose"> | <boolean>

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

Type:

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

Type:
<false> | <"text/javascript"> | <"module">

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

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

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

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

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

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

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>

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

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>

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.

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>

The number of parallel processed modules in the compilation.

Configuration for web performance recommendations.

Type:

Filter function to select assets that are checked.

Type:
{AssetFilter}

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

Type:
<false> | <"warning"> | <"error">

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

Total size of an entry point (in bytes).

Add additional plugins to the compiler.

Type:
{(false | 0 | '' | null | undefined | WebpackPluginInstance | WebpackPluginFunction)[]}

Capture timing information for each module.

Store compiler state to a json file.

Type:
<false> | <string>

Load compiler state from a json file.

Type:
<false> | <string>

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>

Options for the resolver.

Redirect module requests.

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

Type:
{(string[] | string)[]}

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

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

Predicate function to decide which requests should be cached.

Type:

Include the context information in the cache identifier when caching.

Condition names for exports field entry point.

[]

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

[]

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

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

[]

An object which maps extension to extension aliases.

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

[]

Redirect module requests when normal resolving fails.

Filesystem for the resolver.

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

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

[]

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

Type:
{(string[] | string)[]}

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

[]

Folder names or directory paths where to find modules.

[]

Plugins for the resolver.

Type:
[ <("..." | false | 0 | '' | null | undefined | object | ((this: Resolver, arg1: Resolver) => void))> ]((".html#--false--0----null--undefined--object--this-resolver-arg1-resolver--void)[]

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

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

Custom resolver.

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)[]}

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

[]

Enable resolving symlinks to the original location.

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

configFile:<string>
A path to the tsconfig file.
references:
<"auto"> | <string> - References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths.

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

Use synchronous filesystem calls for the resolver.

Options for the resolver when resolving loaders.

Redirect module requests.

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

Type:
{(string[] | string)[]}

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

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

Predicate function to decide which requests should be cached.

Type:

Include the context information in the cache identifier when caching.

Condition names for exports field entry point.

[]

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

[]

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

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

[]

An object which maps extension to extension aliases.

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

[]

Redirect module requests when normal resolving fails.

Filesystem for the resolver.

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

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

[]

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

Type:
{(string[] | string)[]}

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

[]

Folder names or directory paths where to find modules.

[]

Plugins for the resolver.

Type:
[ <("..." | false | 0 | '' | null | undefined | object | ((this: Resolver, arg1: Resolver) => void))> ]((".html#--false--0----null--undefined--object--this-resolver-arg1-resolver--void)[]

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

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

Custom resolver.

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)[]}

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

[]

Enable resolving symlinks to the original location.

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

configFile:<string>
A path to the tsconfig file.
references:
<"auto"> | <string> - References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths.

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

Use synchronous filesystem calls for the resolver.

Options affecting how file system snapshots are created and validated.

Type:
{SnapshotOptions}

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

Use hashes of the content of the files/directories to determine invalidation.
timestamp:<boolean>
Use timestamps of the files/directories to determine invalidation.

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

Use hashes of the content of the files/directories to determine invalidation.
timestamp:<boolean>
Use timestamps of the files/directories to determine invalidation.

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)[]}

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

Type:
{(RegExp | string)[]}

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

Use hashes of the content of the files/directories to determine invalidation.
timestamp:<boolean>
Use timestamps of the files/directories to determine invalidation.

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

Use hashes of the content of the files/directories to determine invalidation.
timestamp:<boolean>
Use timestamps of the files/directories to determine invalidation.

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

Use hashes of the content of the files/directories to determine invalidation.
timestamp:<boolean>
Use timestamps of the files/directories to determine invalidation.

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

Type:
{(RegExp | string)[]}

Stats options object or preset name.

Type:
<"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).

Add assets information.

Sort the assets by that field.

Type:
<false> | <string>

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

Add built at time information.

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

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

Add information about cached (not built) modules.

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

Display auxiliary assets in chunk groups.

Display children of chunk groups.

Limit of assets displayed in chunk groups.

Display all chunk groups with the corresponding bundles.

Add built modules information to chunk information.

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

Add the origins of chunks and chunk merging info.

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

Add chunk information.

Sort the chunks by that field.

Type:
<false> | <string>

Enables/Disables colorful output.

Custom color for bold text.
Custom color for cyan text.
green:<string>
Custom color for green text.
magenta:<string>
Custom color for magenta text.
Custom color for red text.
yellow:<string>
Custom color for yellow text.

Context directory for request shortening.

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

Add module depth in module graph.

Display the entry points with the corresponding bundles.

Type:
<"auto"> | <boolean>

Add --env information.

Add cause to errors.

Type:
<"auto"> | <boolean>

Add details to errors (like resolving log).

Type:
<"auto"> | <boolean>

Add nested errors to errors (like in AggregateError).

Type:
<"auto"> | <boolean>

Add internal stack trace to errors.

Add errors.

Add errors count.

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

Please use excludeModules instead.

Type:<boolean> | <(RegExp | string | ModuleFilterItemTypeFn)[]> | <RegExp> | <string> | <ModuleFilterItemTypeFn>

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

Type:
<(RegExp | string | AssetFilterItemFn)[]> | <RegExp> | <string> | <AssetFilterItemFn>

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

Type:<boolean> | <(RegExp | string | ModuleFilterItemTypeFn)[]> | <RegExp> | <string> | <ModuleFilterItemTypeFn>

Group assets by how their are related to chunks.

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

Group assets by their extension.

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

Group assets by their path.

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

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

Group modules by their extension.

Group modules by their layer.

Group modules by their path.

Group modules by their type.

Group reasons by their origin module.

Add the hash of the compilation.

Add ids.

Add logging output.

Type:
<"none"> | <"error"> | <"warn"> | <"info"> | <"log"> | <"verbose"> | <boolean>

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>

Add stack traces to logging output.

Add information about assets inside modules.

Add dependencies and origin of warnings/errors.

Add built modules information.

Sort the modules by that field.

Type:
<false> | <string>

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

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

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

Show reasons why optimization bailed out for modules.

Add information about orphan modules.

Add output path information.

Add performance hint flags.

Preset for the default values.

Show exports provided by modules.

Add public path information.

Add information about the reasons why modules are included.

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

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

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

Add information about runtime modules.

Add the source code of modules.

Add timing information.

Show exports used by modules.

Add webpack version information.

Add warnings.

Add warnings count.

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>

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

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

[] | <false> | <string>

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.

Enter watch mode, which rebuilds on file change.

Options for the watcher.

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

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

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

Enable polling mode for watching.

Stop watching when stdin stream has ended.