On this page

Enables/Disables integrated optimizations.

Type:boolean

Avoid wrapping the entry module in an IIFE.

Type:boolean

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

Type:false | "size" | "natural" | "named" | "deterministic" | "total-size"

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

Concatenate modules when possible to generate less modules, more efficient code and enable more optimizations by the minimizer. An options object implies 'true'.

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

Inline ESM exports that bind to small primitive constants (≤6-byte null/undefined/boolean/number/string). Inlining makes the import dependency inactive so DCE can drop the export and possibly the module.

Type:boolean

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

Type:boolean | "size" | "deterministic"

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: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:("..." | WebpackPluginInstance | ((this: Compiler, compiler: Compiler) => void))[]

Minimizer(s) to use for minimizing the output.

Type:false | "size" | "natural" | "named" | "deterministic" | "hashed"

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:string | false

Set process.env.NODE_ENV to a specific value.

Stability: 0Deprecated
Type:boolean

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

Type:boolean

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:false | Object

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

optimizationNormalized.runtimeChunk.name(entrypoint): string
Attributes
entrypoint:Object
name:string
Returns:string

The name factory for the runtime chunks.

Type:boolean | "flag"

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

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

Type:boolean | "global"

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