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.

Type:boolean

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

Type:true | false | MemoryCacheOptions | FileCacheOptions

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

References to other configurations to depend on.

Type:string[]

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

Type:object[] | 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_'.

Type:string[] | string

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

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.

Type:boolean

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

Type:boolean

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.

Type:boolean

Enable css support.

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

Type:boolean

Apply defaults of next major version.

Type:boolean

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

Type:boolean

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

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

Allow output javascript files as module source type.

Type:boolean

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

Type:boolean

Support WebAssembly as synchronous EcmaScript Module (outdated).

Type:boolean

Enable typescript support.

Type:boolean

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

Type:string[] | string

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.

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.

Type:boolean

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

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

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

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

Type:boolean

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

Type:boolean

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

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

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.

Type:boolean

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

Type:boolean

Custom console used for logging.

Type:Console

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.

Type:Loader

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

Enable warnings for full dynamic dependencies.

Type:boolean

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

Type:boolean

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

Type:string

Specify options for each generator.

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

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.
asset/bytes:EmptyParserOptions
No parser options are supported for this module type.
asset/inline:EmptyParserOptions
No parser options are supported for this module type.
asset/resource:EmptyParserOptions
No parser options are supported for this module type.
asset/source:EmptyParserOptions
No parser options are supported for this module type.
Parser options for css modules.
Parser options for css/auto and css/module modules.
Parser options for css/global modules.
Parser options for css/auto and css/module modules.
Parser options for javascript modules.
javascript/auto:JavascriptParserOptions
Parser options for javascript modules.
javascript/dynamic:JavascriptParserOptions
Parser options for javascript modules.
Parser options for javascript modules.
Parser options for JSON modules.

An array of rules applied for modules.

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

Type:boolean

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

Type:boolean

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

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

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

Type:string

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

Type:boolean

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

Type:boolean

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

Type:RegExp

Name of the configuration. Used when loading multiple configurations.

Type:string

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.

Type:boolean

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

Type:boolean

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.

Type:boolean

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

Type:boolean

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

Type:boolean

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

Type:boolean

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.

Type:boolean

Merge chunks which contain the same modules.

Type:boolean

Enable minimizing the output. Uses optimization.minimizer.

Type:boolean

Minimizer(s) to use for minimizing the output.

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

Type:boolean

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.

Type:boolean

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

Type:boolean

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

Type:boolean

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

Type:boolean

Remove chunks which are empty.

Type:boolean

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.

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

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.

Type:Output
Type:string

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

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

Type:boolean
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.

Add charset attribute for script tag.

Type:boolean

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.

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.

Type:number

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.

Type:string

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.

Type:boolean

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.

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.

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.

Type:string

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.

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

Type:string

Digest types used for the hash.

Type:string

Number of chars which are used for the hash.

Type:number

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

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

Type:string

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

Type:string

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

Type:string

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

Type:string

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.

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.

Ignore warnings in the browser.

Type:boolean

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

Type:boolean

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

Type:string

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

Type:string

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

Type:string[] | string
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.

Type:boolean

The output directory as absolute path (required).

Type:string

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:"auto" | string | TemplatePathFn

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.

Type:string

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

Type:string

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

Type:boolean

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

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

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

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

Type:string

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.

Type:string

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.

Type:string

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.

Type:number

Configuration for web performance recommendations.

Type:false | PerformanceOptions

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.

Type:number

Total size of an entry point (in bytes).

Type:number

Add additional plugins to the compiler.

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

Capture timing information for each module.

Type:boolean

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.

Type:object[] | object

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

Type:object

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

Type:boolean

Predicate function to decide which requests should be cached.

Type:((request: ResolveRequest) => boolean)

Include the context information in the cache identifier when caching.

Type:boolean

Condition names for exports field entry point.

Type:string[]

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

Type:string[]

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

Type:boolean

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

Type:string[]

An object which maps extension to extension aliases.

Type:object

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

Type:string[]

Redirect module requests when normal resolving fails.

Type:object[] | object

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

Type:boolean

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

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.

Type:string[]

Folder names or directory paths where to find modules.

Type:string[]

Plugins for the resolver.

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

Type:boolean

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

Type:boolean

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.

Type:string[]

Enable resolving symlinks to the original location.

Type:boolean

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.

Type:boolean

Options for the resolver when resolving loaders.

Redirect module requests.

Type:object[] | object

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

Type:object

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

Type:boolean

Predicate function to decide which requests should be cached.

Type:((request: ResolveRequest) => boolean)

Include the context information in the cache identifier when caching.

Type:boolean

Condition names for exports field entry point.

Type:string[]

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

Type:string[]

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

Type:boolean

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

Type:string[]

An object which maps extension to extension aliases.

Type:object

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

Type:string[]

Redirect module requests when normal resolving fails.

Type:object[] | object

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

Type:boolean

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

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.

Type:string[]

Folder names or directory paths where to find modules.

Type:string[]

Plugins for the resolver.

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

Type:boolean

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

Type:boolean

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.

Type:string[]

Enable resolving symlinks to the original location.

Type:boolean

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.

Type:boolean

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.

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.

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

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.

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.

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.

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

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.

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

Type:object
hash:boolean
Use hashes of the content of the files/directories to determine invalidation.
timestamp:boolean
Use timestamps of the files/directories to determine invalidation.

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

Type:boolean

Add assets information.

Type:boolean

Sort the assets by that field.

Type:false | string

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

Type:number

Add built at time information.

Type:boolean

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

Type:boolean

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

Type:boolean

Add information about cached (not built) modules.

Type:boolean

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

Type:boolean

Display children of chunk groups.

Type:boolean

Limit of assets displayed in chunk groups.

Type:number

Display all chunk groups with the corresponding bundles.

Type:boolean

Add built modules information to chunk information.

Type:boolean

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

Type:number

Add the origins of chunks and chunk merging info.

Type:boolean

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

Type:boolean

Add chunk information.

Type:boolean

Sort the chunks by that field.

Type:false | string

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.

Context directory for request shortening.

Type:string

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

Type:boolean

Add module depth in module graph.

Type:boolean

Display the entry points with the corresponding bundles.

Type:"auto" | boolean

Add --env information.

Type:boolean

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.

Type:boolean

Add errors.

Type:boolean

Add errors count.

Type:boolean

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

Type:number

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.

Type:boolean

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

Type:boolean

Group assets by their extension.

Type:boolean

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

Type:boolean

Group assets by their path.

Type:boolean

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

Type:boolean

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

Type:boolean

Group modules by their extension.

Type:boolean

Group modules by their layer.

Type:boolean

Group modules by their path.

Type:boolean

Group modules by their type.

Type:boolean

Group reasons by their origin module.

Type:boolean

Add the hash of the compilation.

Type:boolean

Add ids.

Type:boolean

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.

Type:boolean

Add information about assets inside modules.

Type:boolean

Add dependencies and origin of warnings/errors.

Type:boolean

Add built modules information.

Type:boolean

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

Type:number

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

Type:boolean

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

Show reasons why optimization bailed out for modules.

Type:boolean

Add information about orphan modules.

Type:boolean

Add output path information.

Type:boolean

Add performance hint flags.

Type:boolean

Preset for the default values.

Show exports provided by modules.

Type:boolean

Add public path information.

Type:boolean

Add information about the reasons why modules are included.

Type:boolean

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

Type:number

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

Type:boolean

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

Type:boolean

Add information about runtime modules.

Type:boolean

Add the source code of modules.

Type:boolean

Add timing information.

Type:boolean

Show exports used by modules.

Type:boolean

Add webpack version information.

Type:boolean

Add warnings.

Type:boolean

Add warnings count.

Type:boolean

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

Type:number

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

Type:string[] | 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.

Type:boolean

Enter watch mode, which rebuilds on file change.

Type:boolean

Options for the watcher.

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

Type:number

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

Type:boolean

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

Type:string[] | RegExp | string

Enable polling mode for watching.

Stop watching when stdin stream has ended.

Type:boolean