On this page

These types are not exported by webpack, but they are available to TypeScript consumers.

Advanced options for cleaning assets.

Attributes
Log the assets that should be removed instead of deleting them.
keep:string | RegExp | ((path: string) => boolean | undefined)
Keep these assets.

Attributes
declaration-ordered list
bucketed by first char code
hasAnyFirstChar:boolean
true when an empty-prefix wildcard is present
useBuckets:boolean
true when the bucket fast-path should be used at resolve time

Options object as provided by the user.

Attributes
amd:false | { [index: string]: any }
Set the value of require.amd and define.amd . Or disable AMD support.
bail:boolean
Report the first error as a hard error instead of tolerating it.
Cache generated modules and chunks to improve performance for multiple incremental builds.
context:string
The base directory (absolute path!) for resolving the entry option. If output.pathinfo is set, the included pathinfo is shortened to this directory.
dependencies:string[]
References to other configurations to depend on.
devtool:string | false | { type: "css" | "javascript" | "all"; use: RawDevTool }[]
A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
Enable and configure the Dotenv plugin to load environment variables from .env files.
The entry point(s) of the compilation.
experiments:Experiments
Enables/Disables experiments (experimental features with relax SemVer compatibility).
extends:string | string[]
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 .
externalsPresets:ExternalsPresets
Enable presets of externals for specific targets.
externalsType:"asset" | "module" | "asset-url" | "css-import" | "promise" | "global" | "import" | "this" | "var" | "commonjs" | "self" | "script" | "jsonp" | "assign" | "window" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "amd-async" | "umd" | "umd2" | "system" | "module-import" | "node-commonjs" | "css-url"
Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
ignoreWarnings:(RegExp | { file?: RegExp; message?: RegExp; module?: RegExp } | ((warning: Error, compilation: Compilation) => boolean))[]
Ignore specific warnings.
infrastructureLogging:InfrastructureLogging
Options for infrastructure level logging.
loader:Loader
Custom values available in the loader context.
mode:"development" | "none" | "production"
Enable production optimizations or development hints.
Options affecting the normal modules ( NormalModuleFactory ).
name:string
Name of the configuration. Used when loading multiple configurations.
node:false | NodeOptions
Include polyfills or mocks for various node stuff.
optimization:Optimization
Enables/Disables integrated optimizations.
output:Output
Options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.
parallelism:number
The number of parallel processed modules in the compilation.
performance:false | PerformanceOptions
Configuration for web performance recommendations.
plugins:(false | "" | 0 | WebpackPluginInstance | ((this: Compiler, compiler: Compiler) => void) | null | undefined)[]
Add additional plugins to the compiler.
profile:boolean
Capture timing information for each module.
recordsInputPath:string | false
Store compiler state to a json file.
recordsOutputPath:string | false
Load compiler state from a json file.
recordsPath:string | false
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.
Options for the resolver.
resolveLoader:ResolveOptions
Options for the resolver when resolving loaders.
Options affecting how file system snapshots are created and validated.
stats:boolean | "none" | "verbose" | "summary" | "errors-only" | "errors-warnings" | "minimal" | "normal" | "detailed" | StatsOptions
Stats options object or preset name.
target:string | false | string[]
Environment to build for. An array of environments to build for all of them when possible.
validate:boolean
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.
watch:boolean
Enter watch mode, which rebuilds on file change.
watchOptions:WatchOptions
Options for the watcher.

Attributes
addon:string
attributes:Record<string, string>
caseSensitive:boolean
case-sensitive matching for import.meta.glob
category:string
chunkName:string | null
exclude:RegExp | null
exhaustive:boolean
exhaustive mode for import.meta.glob
importName:string
import selection for import.meta.glob
include:RegExp | null
layer:string | null
namespaceObject:boolean | "strict"
patterns:string[]
glob patterns for import.meta.glob
phase:0 | 2 | 1
recursive:boolean
referencedExports:string[][] | null
exports referenced from modules (won't be mangled)
regExp:false | RegExp | null
requestContext:string
importer context for import.meta.glob
typePrefix:string

Generator options for css modules.

Attributes
esModule:boolean
Configure the generated JS modules that use the ES modules syntax.
exportsOnly:boolean
Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.

Parser options for css modules.

Attributes
as:"stylesheet" | "block-contents"
Configure how the CSS source is parsed: as a full stylesheet (default) or as a block's contents (e.g. the content of an HTML style attribute).
customMedia:boolean
Enable/disable resolution of @custom-media at-rules (file-local build-time substitution).
customSelectors:boolean
Enable/disable resolution of @custom-selector at-rules (file-local build-time expansion to :is(...) ).
exportType:"link" | "text" | "css-style-sheet" | "style"
Configure how CSS content is exported as default.
fontPreload:boolean
Auto-emit <link rel="preload" as="font"> for the primary src URL of each @font-face reachable from an HTML entry's initial CSS. Only the first URL per @font-face is preloaded (preloading every format would double-download). Off by default; parser.css.urlHints rules and per-URL magic comments still override the seeded defaults. Set output.crossOriginLoading so the preload matches the font's CORS fetch.
import:boolean
Enable/disable @import at-rules handling.
namedExports:boolean
Use ES modules named export for css exports.
Enable/disable url() / image-set() / src() / image() functions handling.
urlHints:UrlHintRule[]
URL-referenced-asset default hint rules for this parser (JavaScript new URL(...) , CSS url(...) , HTML <img src> / <link href> / <script src> ).

Options for Dotenv plugin.

Attributes
dir:string | false
The directory from which .env files are loaded. Can be an absolute path, false will disable the .env file loading.
prefix:string | string[]
Only expose environment variables that start with these prefixes. Defaults to 'WEBPACK_'.
template: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'].

No generator options are supported for this module type.


No parser options are supported for this module type.


  • [index: {string}] any

Generator options for html modules.

Attributes
extract:boolean | "inline"
Emit the parsed and URL-rewritten HTML as a standalone .html output file alongside the module's JavaScript export. true always emits the file; false never does; "inline" exposes the processed HTML for inline write-back (e.g. <iframe srcdoc> ) without emitting a standalone file. When unset, extraction defaults to true for HTML modules used as compilation entries (HTML entry points) and false for HTML modules imported from JavaScript. Filenames follow output.htmlFilename / output.htmlChunkFilename .

Parser options for html modules.

Attributes
Configure how the HTML source is parsed: "document" (the default) parses a full page; any other value is the tag name of the context element to parse the source as that element's inner HTML (a fragment) — e.g. "template" for a neutral fragment, or "tbody" so context-sensitive tags like a bare <tr> / <td> are kept instead of dropped.
sources:boolean | ("..." | { attribute: string; filter?: (attributes: Map<string, string>, value: string) => boolean; tag?: string; type: false | "html" | "script" | "src" | "stylesheet" | "css-url" | "srcset" | "script-module" | "stylesheet-style" | "stylesheet-style-attribute" | "srcdoc" })[]
Configure extraction of URL-like attribute values (e.g. <img src> , <link href> , <script src> ) as webpack dependencies. true (default) uses the built-in source list; false disables extraction entirely so attributes are left untouched and <script src> / <link rel="modulepreload"> / <link rel="stylesheet"> no longer become compilation entries; an array lets you customize which tag / attribute pairs are treated as URLs and how they are bundled. Use the string "..." inside the array to inline the defaults. Inline <script> and <style> bodies are always processed. Use webpackIgnore comments or IgnorePlugin to skip individual URLs.
template:(source: string, context: HtmlTemplateContext) => string
Transform the raw source before the html parser extracts dependencies. Receives the source string and a context ( { module, resource } ) and must return the html string to parse. Useful for compiling a templating language (Handlebars, EJS, Eta, …) to html so that URLs the template emits are still picked up as webpack dependencies. Runs synchronously.
urlHints:UrlHintRule[]
URL-referenced-asset default hint rules for this parser (JavaScript new URL(...) , CSS url(...) , HTML <img src> / <link href> / <script src> ).

A custom resource-hint <link> for output.html.resourceHints. Exactly one of href / chunk / entry names the target.

Attributes
The as attribute ( script , style , font , …); defaults to script for chunk/entry references.
chunk:string
Name of a chunk to hint; its emitted URL is resolved automatically.
crossorigin:boolean | "use-credentials" | "anonymous"
The CORS mode; true maps to anonymous .
entry:string
Name of an entrypoint to hint; expands to one hint per initial chunk.
fetchPriority:"auto" | "high" | "low"
The fetchpriority attribute. Emitted on preload / modulepreload and on prefetch (the spec now permits it there).
href:string
A literal URL used verbatim (external resource, preconnect origin, or an already-hashed asset).
integrity:boolean
Subresource Integrity for a chunk/entry reference. Follows output.html.integrity by default; set false to opt this hint out.
media:string
The media attribute.
rel:"preload" | "prefetch" | "modulepreload" | "preconnect" | "dns-prefetch"
The rel of the resource hint.
type:string
The type attribute (MIME type).

Options for building http resources.

Attributes
allowedUris:(string | RegExp | ((uri: string) => boolean))[]
List of allowed URIs (resp. the beginning of them).
cacheLocation:string | false
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.

Parser options for javascript modules.

Attributes
amd:false | { [index: string]: any }
Set the value of require.amd and define.amd . Or disable AMD support.
anonymousDefaultExportName:boolean
Set .name to "default" for anonymous default export functions and classes per ES spec. Disable to reduce output size when .name is not needed.
browserify:boolean
Enable/disable special handling for browserify bundles.
commonjs:boolean
Enable/disable parsing of CommonJs syntax.
commonjsMagicComments:boolean
Enable/disable parsing of magic comments in CommonJs syntax.
createRequire:string | boolean
Enable/disable parsing "import createRequire from "module"" and evaluating createRequire().
deferImport:boolean
Enable experimental tc39 proposal https://github.com/tc39/proposal-defer-import-eval . This allows to defer execution of a module until it's first use.
dynamicImportCssPreload:number | boolean
Auto-emit <link rel="preload" as="style"> for the CSS of every dynamically imported ( import() ) chunk, so the stylesheet fetches in parallel with the chunk's JavaScript instead of after it parses. Unlike dynamicImportPreload , the JavaScript itself is not preloaded. true uses the default order; a number sets the preload order.
dynamicImportFetchPriority:false | "auto" | "high" | "low"
Specifies global fetchPriority for dynamic import.
dynamicImportMode:"eager" | "weak" | "lazy" | "lazy-once"
Specifies global mode for dynamic import.
dynamicImportPrefetch:number | boolean
Specifies global prefetch for dynamic import.
dynamicImportPreload:number | boolean
Specifies global preload for dynamic import.
dynamicUrl:boolean
Enable/disable parsing of dynamic URL.
exportsPresence:false | "error" | "warn" | "auto"
Specifies the behavior of invalid export names in "import ... from ..." and "export ... from ...".
exprContextCritical:boolean
Enable warnings for full dynamic dependencies.
exprContextRecursive:boolean
Enable recursive directory lookup for full dynamic dependencies.
exprContextRegExp:boolean | RegExp
Sets the default regular expression for full dynamic dependencies.
exprContextRequest:string
Set the default request for full dynamic dependencies.
harmony:boolean
Enable/disable parsing of EcmaScript Modules syntax.
import:boolean
Enable/disable parsing of import() syntax.
importExportsPresence:false | "error" | "warn" | "auto"
Specifies the behavior of invalid export names in "import ... from ...".
importMeta:boolean | "preserve-unknown" | ImportMetaParserOptions
Enable/disable evaluating import.meta. Set to 'preserve-unknown' or an object to preserve unknown properties for runtime evaluation.
importMetaContext:boolean
Deprecated in favor of "importMeta" object option with a "webpackContext" field. Enable/disable evaluating import.meta.webpackContext.
node:false | NodeOptions
Include polyfills or mocks for various node stuff.
overrideStrict:"strict" | "non-strict"
Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
parse:(code: string, options: ParseOptions) => ParseResult
Function to parser source code.
pureFunctions:string[]
Mark the listed top-level function names for pure-function-based tree shaking.
reexportExportsPresence:false | "error" | "warn" | "auto"
Specifies the behavior of invalid export names in "export ... from ...". This might be useful to disable during the migration from "export ... from ..." to "export type ... from ..." when reexporting types in TypeScript.
requireContext:boolean
Enable/disable parsing of require.context syntax.
requireEnsure:boolean
Enable/disable parsing of require.ensure syntax.
requireInclude:boolean
Enable/disable parsing of require.include syntax.
requireJs:boolean
Enable/disable parsing of require.js special syntax like require.config, requirejs.config, require.version and requirejs.onError.
sourceImport:boolean
Enable experimental tc39 proposal https://github.com/tc39/proposal-source-phase-imports . This allows importing modules at source phase.
strictExportPresence:boolean
Deprecated in favor of "exportsPresence". Emit errors instead of warnings when imported names don't exist in imported module.
strictModeViolations:false | "error" | "warn"
Specifies the behavior of constructs that break at runtime in strict mode (e.g. 'with', 'arguments.callee', assigning to read-only globals) when modules are emitted as ES module output.
strictThisContextOnImports:boolean
Handle the this context correctly according to the spec for namespace objects.
system:boolean
Enable/disable parsing of System.js special syntax like System.import, System.get, System.set and System.register.
typescript:boolean
Enable typescript support.
unknownContextCritical:boolean
Enable warnings when using the require function in a not statically analyse-able way.
unknownContextRecursive:boolean
Enable recursive directory lookup when using the require function in a not statically analyse-able way.
unknownContextRegExp:boolean | RegExp
Sets the regular expression when using the require function in a not statically analyse-able way.
unknownContextRequest:string
Sets the request when using the require function in a not statically analyse-able way.
url:boolean | "relative"
Enable/disable parsing of new URL() syntax.
urlHints:UrlHintRule[]
URL-referenced-asset default hint rules for this parser (JavaScript new URL(...) , CSS url(...) , HTML <img src> / <link href> / <script src> ).
worker:boolean | string[]
Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
worklet:boolean | string[]
Disable or configure parsing of Worklet syntax like context.audioWorklet.addModule() or CSS.paintWorklet.addModule().
wrappedContextCritical:boolean
Enable warnings for partial dynamic dependencies.
wrappedContextRecursive:boolean
Enable recursive directory lookup for partial dynamic dependencies.
wrappedContextRegExp:RegExp
Set the inner regular expression for partial dynamic dependencies.

Generator options for json modules.

Attributes
JSONParse:boolean
Use JSON.parse when the JSON string is longer than 20 characters.

Parser options for JSON modules.

Attributes
exportsDepth:number
The depth of json dependency flagged as exportInfo .
namedExports:boolean
Allow named exports for json of object type.
parse:(input: string) => string | number | boolean | Buffer<ArrayBufferLike> | JsonObjectFs | JsonValueFs[] | null
Function to parser content and return JSON.

Options for the default backend.

Attributes
client:string
A custom client.
listen:number | ListenOptions | ((server: ServerLazyCompilationBackend) => void)
Specifies where to listen to from the server.
protocol:"http" | "https"
Specifies the protocol the client should use to connect to the server.
server:ServerOptions<typeof IncomingMessage, typeof ServerResponse> | ServerOptions<typeof IncomingMessage, typeof ServerResponse> | (() => ServerLazyCompilationBackend)
Specifies how to create the server handling the EventSource requests.

Options for compiling entrypoints and import()s only when they are accessed.

Attributes
backend:((compiler: Compiler, callback: (err: Error | null, backendApi?: BackendApi) => void) => void) | ((compiler: Compiler) => Promise<BackendApi>) | 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:string | RegExp | ((module: Module) => boolean)
Specify which entrypoints or import()ed modules should be lazily compiled. This is matched with the imported module and not the entrypoint name.

  • [index: {string}] any

Attributes
associatedObjectForCache:object
object for caching
context:string
absolute context path to which lib ident is relative to

Attributes
mode:string | number
recursive:boolean

Attributes
columns:boolean
need columns?
module:boolean
is module

Attributes
parallelism:number
how many Compilers are allows to run at the same time in parallel

Options object for node compatibility features.

Attributes
__dirname:boolean | "warn-mock" | "mock" | "node-module" | "eval-only"
Include a polyfill for the '__dirname' variable.
__filename:boolean | "warn-mock" | "mock" | "node-module" | "eval-only"
Include a polyfill for the '__filename' variable.
global:boolean | "warn"
Include a polyfill for the 'global' variable.

Options for the generated HTML files.

Attributes
base:string | { href: string; target?: string }
Inject a <base> element into the page <head> . A string sets href ; an object sets both href and optionally target . Skipped if the HTML already contains a <base> element.
csp:boolean | { hashFunction?: "sha256" | "sha384" | "sha512"; nonce?: string; policy?: { [index: string]: string | string[] } }
Inject a <meta http-equiv="Content-Security-Policy"> into every webpack-emitted HTML page. false (default) does nothing; true uses a strict baseline ( script-src 'self' , style-src 'self' , object-src 'none' , base-uri 'self' ) and appends a sha256 hash of every inline <script> / <style> to script-src / style-src . An object customizes it. Skipped when the page already declares a CSP.
favicon:string | boolean | { [index: string]: string | { color?: string; crossorigin?: "use-credentials" | "anonymous"; href: string; media?: string; sizes?: string; type?: string } | HtmlFaviconIcon[] } | ((name: string) => string | boolean | { [index: string]: string | HtmlFaviconIcon[] | { color?: string; crossorigin?: "use-credentials" | "anonymous"; href: string; media?: string; sizes?: string; type?: string } })
Favicon(s) for webpack-generated HTML (authored pages are left untouched). false (default) injects nothing; true injects the webpack logo; a string is a path to an icon; an object maps each <link rel> to an icon — a path string, an object with the icon href plus extra link attributes ( sizes , media , color , type , crossorigin ), or an array of these for multiple icons under the same rel (e.g. several sizes , or light/dark media variants); a function receives the page name and returns one of these. Every icon is emitted as a hashed asset.
inject:false | "body" | "head"
Where to place injected chunk <script> / <link> tags. "body" (default; "head" with output.module ) keeps them next to the entry tag — end of <body> on generated pages; "head" moves them into <head> ; false suppresses sibling-chunk injection (entry tags and resource hints remain).
inline:boolean | "script" | "style" | RegExp[]
Inline the content of matching chunks directly into the HTML instead of emitting a separate <script> / <link> tag. true inlines every chunk; "script" inlines only JavaScript, "style" only CSS; an array of RegExp patterns matches against the chunk name.
integrity:boolean | string[] | ((asset: { chunk: Chunk; filename: string }) => false | string[])
Add Subresource Integrity (SRI) integrity attributes to injected <script> / <link> tags. true uses ['sha384'] ; an array sets the hash algorithms; a function receives each referenced asset and returns the algorithms to use or false to skip it.
manifest:string | false | { [index: string]: any } | ((name: string) => string | false | { [index: string]: any })
Web app manifest for webpack-generated HTML (authored pages are left untouched). false (default) injects nothing. A string is a path to an existing .webmanifest file to link. An object is the manifest contents — serialized, emitted as a hashed .webmanifest and linked with <link rel="manifest"> ; its icons / screenshots src paths resolve like any request and are emitted as hashed assets. A function receives the page name and returns one of these.
meta:{ [index: string]: string }
Inject <meta> tags into the page <head> . Each key is the name attribute (or "charset" for a charset declaration); the value is the content string. Keys beginning with og: use the property attribute instead of name . A tag is skipped if the HTML already contains a meta with the same name.
scriptLoading:"defer" | "auto" | "blocking"
How injected <script> tags load. auto (default) emits a module script for ES module output and defer otherwise; defer forces a deferred script; blocking emits a plain blocking script.
title:string
Sets the <title> of the generated HTML page. Skipped if the HTML already contains a <title> element.

Attributes
allowHashBang:boolean
allowReturnOutsideFunction:boolean
comments:boolean
ecmaVersion:ecmaVersion
importPhases:boolean
enable parsing of the import phase proposals (import defer / import source)
internal: collect comments here without slicing their text eagerly
lazyNodes:boolean
internal: serve range lazily and skip acorn's location/range tracking
locations:boolean
moduleFallback:boolean
internal: for auto , let the parser downgrade module->script in place instead of re-parsing
ranges:boolean
sourceType:"module" | "script"

  • [index: {string}] any

Configuration object for web performance recommendations.

Attributes
assetFilter:(name: string, source: Source, assetInfo: AssetInfo) => boolean
Filter function to select assets that are checked.
hints:false | "error" | "warning"
Sets the format of the hints: warnings, errors or nothing at all.
maxAssetSize:number
File size limit (in bytes) when exceeded, that webpack will provide performance hints.
maxEntrypointSize:number
Total size of an entry point (in bytes).

Returns location of targetPath relative to rootPath.

Attributes
buffer:TBuffer
length:number
offset:number
position:number | bigint | null

Full resource-hint configuration.

Attributes
initial:boolean | "preload" | "prefetch" | "none" | HtmlResourceHintWebpackOptions[] | ((context: { compilation: Compilation; defaultHints: (HtmlResourceHintHtmlEntryDependency & { hostChunks: string[] })[]; entryName: string; entrypoint: Entrypoint; hostType: "html" | "js" }) => HtmlResourceHintHtmlEntryDependency[])
Initial dependency-graph chunk hints. true auto-emits <link rel="modulepreload"> (ESM output) or <link rel="preload" as="script"> (classic) for each of the entry's initial dependency chunks; "prefetch" uses <link rel="prefetch"> ; "preload" is an alias of true ; false disables chunk hints (URL-asset hints from magic comments / urlHints still fire); "none" is a hard off switch (no <link> anywhere, empty stats / manifest); an array of HtmlResourceHint descriptors replaces the auto set; a function receives the auto defaultHints plus context ( entryName , entrypoint , hostType: "html" | "js" , compilation ) and returns the final list (replaces the removed resolveDependencies hook).
manifest:string
Emit a JSON manifest of the resolved resource hints for each entrypoint (the same descriptors as stats.entrypoints[].resourceHints ) as an output asset at this path. Lets an SSR server inject the <link> tags itself without walking the chunk graph — webpack's analogue of Vite's build.ssrManifest . Empty when initial is "none" .
modulePreloadPolyfill:boolean
Inject a tiny inline <script> polyfill for <link rel="modulepreload"> into extracted HTML pages. Defaults from the target's modulepreload support ( output.environment.modulePreload ) — true when the environment lacks native support, false when it has it. Set false to never inject (the <link> tags are still emitted but do nothing on browsers without support — useful under a strict CSP that forbids inline scripts).
preconnect:boolean
Auto-emit <link rel="preconnect"> for the origin of a cross-origin output.publicPath (the origin bundles and assets are served from) into extracted HTML entries and the resource-hint stats / manifest. Mirrors output.crossOriginLoading . No-op when publicPath is relative or "auto" .
urlHints:UrlHintRule[]
Project-wide URL-referenced-asset hint rules, applied as the base urlHints of every parser (JavaScript new URL(...) , CSS url(...) , HTML <img src> / <link href> ). Parser-scoped module.parser.<type>.urlHints rules and per-URL magic comments still override these.

Options affecting how file system snapshots are created and validated.

Attributes
buildDependencies:{ hash?: boolean; timestamp?: boolean }
Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
contextModule:{ hash?: boolean; timestamp?: boolean }
Options for snapshotting the context module to determine if it needs to be built again.
immutablePaths:(string | RegExp)[]
List of paths that are managed by a package manager and contain a version or hash in its path so all files are immutable.
managedPaths:(string | RegExp)[]
List of paths that are managed by a package manager and can be trusted to not be modified otherwise.
module:{ hash?: boolean; timestamp?: boolean }
Options for snapshotting dependencies of modules to determine if they need to be built again.
resolve:{ hash?: boolean; timestamp?: boolean }
Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
resolveBuildDependencies:{ hash?: boolean; timestamp?: boolean }
Options for snapshotting the resolving of build dependencies to determine if the build dependencies need to be re-resolved.
unmanagedPaths:(string | RegExp)[]
List of paths that are not managed by a package manager and the contents are subject to change.

Attributes
append:string | false | TemplatePathFn<PathData> | null
Appends the given value to the original asset. Usually the #sourceMappingURL comment. [url] is replaced with a URL to the source map file. false disables the appending.
columns:boolean
Indicates whether column mappings should be used (defaults to true).
debugIds:boolean
Emit debug IDs into source and SourceMap.
exclude:string | RegExp | Rule[] | ((str: string) => boolean)
Exclude modules that match the given value from source map generation.
fallbackModuleFilenameTemplate:string | ((context: ModuleFilenameTemplateContext) => string)
Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap used only if 'moduleFilenameTemplate' would result in a conflict.
fileContext:string
Path prefix to which the [file] placeholder is relative to.
filename:string | false | null
Defines the output filename of the SourceMap (will be inlined if no value is provided).
ignoreList:string | RegExp | Rule[] | ((str: string) => boolean)
Decide whether to ignore source files that match the specified value in the SourceMap.
include:string | RegExp | Rule[] | ((str: string) => boolean)
Include source maps for module paths that match the given value.
module:boolean
Indicates whether SourceMaps from loaders should be used (defaults to true).
moduleFilenameTemplate:string | ((context: ModuleFilenameTemplateContext) => string)
Generator string or function to create identifiers of modules for the 'sources' array in the SourceMap.
namespace:string
Namespace prefix to allow multiple webpack roots in the devtools.
noSources:boolean
Omit the 'sourceContents' array from the SourceMap.
publicPath:string
Provide a custom public path for the SourceMapping comment.
sourceRoot:string
Provide a custom value for the 'sourceRoot' property in the SourceMap.
test:string | RegExp | Rule[] | ((str: string) => boolean)
Include source maps for modules based on their extension (defaults to .js and .css).

Returns location of targetPath relative to rootPath.

Attributes
bigint:boolean
throwIfNoEntry:boolean

Returns location of targetPath relative to rootPath.

Attributes
autoClose:boolean
emitClose:boolean
encoding:"ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"
fd:any
flags:string
mode:number
signal:AbortSignal | null
start:number

Options for the watcher.

Attributes
aggregateTimeout:number
Delay the rebuilt after the first change. Value is a time in ms.
followSymlinks:boolean
Resolve symlinks and watch symlink and real file. This is usually not needed as webpack already resolves symlinks ('resolve.symlinks').
ignored:string | RegExp | string[]
Ignore some files from watching (glob pattern or regexp).
Enable polling mode for watching.
stdin:boolean
Stop watching when stdin stream has ended.

Attributes
devtool:string | false | { type: "css" | "javascript" | "all"; use: RawDevTool }[]

Normalized webpack options object.

Attributes
amd:false | { [index: string]: any }
Set the value of require.amd and define.amd . Or disable AMD support.
bail:boolean
Report the first error as a hard error instead of tolerating it.
Cache generated modules and chunks to improve performance for multiple incremental builds.
context:string
The base directory (absolute path!) for resolving the entry option. If output.pathinfo is set, the included pathinfo is shortened to this directory.
dependencies:string[]
References to other configurations to depend on.
devServer:false | { [index: string]: any }
Options for the webpack-dev-server.
devtool:string | false | { type: "css" | "javascript" | "all"; use: RawDevTool }[]
A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
Enable and configure the Dotenv plugin to load environment variables from .env files.
The entry point(s) of the compilation.
Enables/Disables experiments (experimental features with relax SemVer compatibility).
externals:Externals
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 .
externalsPresets:ExternalsPresets
Enable presets of externals for specific targets.
externalsType:"asset" | "module" | "asset-url" | "css-import" | "promise" | "global" | "import" | "this" | "var" | "commonjs" | "self" | "script" | "jsonp" | "assign" | "window" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "amd-async" | "umd" | "umd2" | "system" | "module-import" | "node-commonjs" | "css-url"
Specifies the default type of externals ('amd*', 'umd*', 'system' and 'jsonp' depend on output.libraryTarget set to the same value).
ignoreWarnings:((warning: Error, compilation: Compilation) => boolean)[]
Ignore specific warnings.
infrastructureLogging:InfrastructureLogging
Options for infrastructure level logging.
loader:Loader
Custom values available in the loader context.
mode:"development" | "none" | "production"
Enable production optimizations or development hints.
Options affecting the normal modules ( NormalModuleFactory ).
name:string
Name of the configuration. Used when loading multiple configurations.
Include polyfills or mocks for various node stuff.
Enables/Disables integrated optimizations.
Normalized options affecting the output of the compilation. output options tell webpack how to write the compiled files to disk.
parallelism:number
The number of parallel processed modules in the compilation.
performance:false | PerformanceOptions
Configuration for web performance recommendations.
plugins:(WebpackPluginInstance | ((this: Compiler, compiler: Compiler) => void))[]
Add additional plugins to the compiler.
profile:boolean
Capture timing information for each module.
recordsInputPath:string | false
Store compiler state to a json file.
recordsOutputPath:string | false
Load compiler state from a json file.
Options for the resolver.
resolveLoader:ResolveOptions
Options for the resolver when resolving loaders.
Options affecting how file system snapshots are created and validated.
Stats options object or preset name.
target:string | false | string[]
Environment to build for. An array of environments to build for all of them when possible.
validate:boolean
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.
watch:boolean
Enter watch mode, which rebuilds on file change.
watchOptions:WatchOptions
Options for the watcher.

Attributes
withOptions:(options: Partial<ResolveOptionsWithDependencyType>) => ResolverWithOptions
create a resolver with additional/different options


Type:ReadonlyArray<Configuration> & MultiCompilerOptions

Type:false | NodeOptions

Attributes

Type:WebpackOptionsNormalized & { context: string } & { infrastructureLogging: InfrastructureLoggingNormalizedWithDefaults } & { target: NonNullable<undefined | string | false | string[]> } & { output: OutputNormalizedWithDefaults } & { optimization: OptimizationNormalizedWithDefaults } & { devtool: NonNullable<undefined | string | false | { type: "css" | "all" | "javascript"; use: RawDevTool }[]> } & { stats: NonNullable<StatsValue> } & { node: NonNullable<NodeWebpackOptions> } & { profile: NonNullable<undefined | boolean> } & { parallelism: number } & { snapshot: SnapshotNormalizedWithDefaults } & { externalsPresets: ExternalsPresetsNormalizedWithDefaults } & { externalsType: NonNullable<undefined | "import" | "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "amd-async" | "promise" | "module-import" | "script" | "node-commonjs" | "asset" | "asset-url" | "css-import" | "css-url"> } & { watch: NonNullable<undefined | boolean> } & { performance: NonNullable<undefined | false | PerformanceOptions> } & { recordsInputPath: NonNullable<undefined | string | false> } & { recordsOutputPath: NonNullable<undefined | string | false> } & { dotenv: NonNullable<undefined | boolean | DotenvPluginOptions> }
Attributes
context:string
Attributes
Attributes
target:NonNullable<undefined | string | false | string[]>
Attributes
Attributes
Attributes
devtool:NonNullable<undefined | string | false | { type: "css" | "all" | "javascript"; use: RawDevTool }[]>
Attributes
Attributes
Attributes
Attributes
parallelism:number
Attributes
Attributes
Attributes
externalsType:NonNullable<undefined | "import" | "var" | "module" | "assign" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "jsonp" | "system" | "amd-async" | "promise" | "module-import" | "script" | "node-commonjs" | "asset" | "asset-url" | "css-import" | "css-url">
Attributes
Attributes
Attributes
recordsInputPath:NonNullable<undefined | string | false>
Attributes
recordsOutputPath:NonNullable<undefined | string | false>
Attributes

Type:null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | ObjectEncodingOptionsFs & Abortable & { flag?: string; flush?: boolean; mode?: string | number }

Attributes