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

Attributes
[] declaration-ordered list
byFirstChar:<Map>
< <number> , <CompiledAliasOption> []> 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.

  • amd <false> | <object> 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 <boolean> | <FileCacheOptions> | <MemoryCacheOptions> 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> | <object>[] A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  • dotenv <boolean> | <DotenvPluginOptions> Enable and configure the Dotenv plugin to load environment variables from .env files.
  • entry <string> | <string>[] | <EntryObject> | <Function> 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).
  • externals <string> | <RegExp> | <ExternalItemObjectKnown> & <ExternalItemObjectUnknown> | <Function> | <Function> | <ExternalItem>[] 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"> | <"global"> | <"import"> | <"promise"> | <"this"> | <"var"> | <"script"> | <"commonjs"> | <"jsonp"> | <"assign"> | <"window"> | <"self"> | <"commonjs2"> | <"commonjs-module"> | <"commonjs-static"> | <"amd"> | <"amd-require"> | <"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> | <object> | <Function>[] 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.
  • module <ModuleOptions> 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> | <Function> | <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.
  • resolve <ResolveOptions> Options for the resolver.
  • resolveLoader <ResolveOptions> Options for the resolver when resolving loaders.
  • snapshot <SnapshotOptionsWebpackOptions> 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> >
category:<string>
chunkName:<string> | <null>
exclude:<RegExp> | <null>
include:<RegExp> | <null>
namespaceObject:<boolean> | <"strict">
phase:
<0> | <2> | <1>
recursive:<boolean>
referencedExports:
<string[][]> | <null> exports referenced from modules (won't be mangled)
regExp:
<false> | <RegExp> | <null>
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.

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

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.
[] 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>
Emit the parsed and URL-rewritten HTML as a standalone  .html output file alongside the module's JavaScript export. When unset, extraction defaults to true for HTML modules used as compilation entries (HTML entry points) and false for HTML modules imported from JavaScript. Filenames follow output.htmlFilename / output.htmlChunkFilename .

Options for building http resources.

Attributes
allowedUris:<string> | <RegExp> | <Function>
[] 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.

  • amd <false> | <object> Set the value of require.amd and define.amd. Or disable AMD support.
  • anonymousDefaultExportName <boolean> Set .name to "default" for anonymous default export functions and classes per ES spec. Disable to reduce output size when .name is not needed.
  • browserify <boolean> Enable/disable special handling for browserify bundles.
  • commonjs <boolean> Enable/disable parsing of CommonJs syntax.
  • commonjsMagicComments <boolean> Enable/disable parsing of magic comments in CommonJs syntax.
  • createRequire <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.
  • dynamicImportFetchPriority <false> | <"auto"> | <"low"> | <"high"> 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"> Enable/disable evaluating import.meta. Set to 'preserve-unknown' to preserve unknown properties for runtime evaluation.
  • importMetaContext <boolean> Enable/disable evaluating import.meta.webpackContext.
  • node <false> | <NodeOptions> Include polyfills or mocks for various node stuff.
  • overrideStrict <"strict"> | <"non-strict"> Override the module to strict or non-strict. This may affect the behavior of the module (some behaviors differ between strict and non-strict), so please configure this option carefully.
  • parse <Function> Function to parser source code.
  • 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.
  • 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.
  • worker <boolean> | <string>[] Disable or configure parsing of WebWorker syntax like new Worker() or navigator.serviceWorker.register().
  • wrappedContextCritical <boolean> Enable warnings for partial dynamic dependencies.
  • wrappedContextRecursive <boolean> Enable recursive directory lookup for partial dynamic dependencies.
  • wrappedContextRegExp <RegExp> Set the inner regular expression for partial dynamic dependencies.

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.
Function to parser content and return JSON.

Options for the default backend.

Attributes
client:<string>
A custom client.
listen:<number> | <ListenOptions> | <Function>
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> > | <Function> Specifies how to create the server handling the EventSource requests.

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

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

Attributes
allowHashBang:<boolean>
allowReturnOutsideFunction:<boolean>
comments:<boolean>
ecmaVersion:<ecmaVersion>
locations:<boolean>
ranges:<boolean>
semicolons:<boolean>
sourceType:
<"module"> | <"script">

  • [index: {string}] <any>

Configuration object for web performance recommendations.

Attributes
assetFilter:<Function>
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.


Options affecting how file system snapshots are created and validated.

Attributes
buildDependencies:<object>
Options for snapshotting build dependencies to determine if the whole cache need to be invalidated.
contextModule:<object>
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:<object>
Options for snapshotting dependencies of modules to determine if they need to be built again.
resolve:<object>
Options for snapshotting dependencies of request resolving to determine if requests need to be re-resolved.
resolveBuildDependencies:<object>
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.
[] | <Function> Exclude modules that match the given value from source map generation.
fallbackModuleFilenameTemplate:<string> | <Function>
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>
[] | <Function> Decide whether to ignore source files that match the specified value in the SourceMap.
[] | <Function> 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> | <Function>
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.
[] | <Function> 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">
flags:<string>
start:<number>

Attributes
baseUrl:<string>
Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file
configFile:<string>
A relative path to the tsconfig file based on cwd, or an absolute path of tsconfig file
references:<string>
[] | <"auto"> References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths

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').
[] 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> | <object>
[]

Normalized webpack options object.

  • amd <false> | <object> 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 <CacheOptionsNormalized> 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> | <object> Options for the webpack-dev-server.
  • devtool <string> | <false> | <object>[] A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
  • dotenv <boolean> | <DotenvPluginOptions> Enable and configure the Dotenv plugin to load environment variables from .env files.
  • entry <EntryNormalized> The entry point(s) of the compilation.
  • experiments <ExperimentsNormalized> 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"> | <"global"> | <"import"> | <"promise"> | <"this"> | <"var"> | <"script"> | <"commonjs"> | <"jsonp"> | <"assign"> | <"window"> | <"self"> | <"commonjs2"> | <"commonjs-module"> | <"commonjs-static"> | <"amd"> | <"amd-require"> | <"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 <Function>[] 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.
  • module <ModuleOptionsNormalized> Options affecting the normal modules (NormalModuleFactory).
  • name <string> Name of the configuration. Used when loading multiple configurations.
  • node <NodeWebpackOptions> Include polyfills or mocks for various node stuff.
  • optimization <OptimizationNormalized> Enables/Disables integrated optimizations.
  • output <OutputNormalized> 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> | <Function>[] 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.
  • resolve <ResolveOptions> Options for the resolver.
  • resolveLoader <ResolveOptions> Options for the resolver when resolving loaders.
  • snapshot <SnapshotOptionsWebpackOptions> Options affecting how file system snapshots are created and validated.
  • stats <StatsValue> 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:<Function>
create a resolver with additional/different options

Type:

Type:
<false> | <NodeOptions>

Attributes

Attributes
context:<string>
Attributes
Attributes
< <undefined> | <string> | <false> | <string> []>
Attributes
Attributes
Attributes
< <undefined> | <string> | <false> | <object> []>
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"> | <"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>

Attributes