Enables/Disables integrated optimizations.

Hierarchy

  • Optimization

Properties

checkWasmTypes?: boolean

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

chunkIds?: false | "natural" | "named" | "deterministic" | "size" | "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).

concatenateModules?: boolean

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

emitOnErrors?: boolean

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

flagIncludedChunks?: boolean

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

innerGraph?: boolean

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

mangleExports?: boolean | "deterministic" | "size"

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

mangleWasmImports?: boolean

Reduce size of WASM by changing imports to shorter strings.

mergeDuplicateChunks?: boolean

Merge chunks which contain the same modules.

minimize?: boolean

Enable minimizing the output. Uses optimization.minimizer.

minimizer?: (WebpackPluginInstance | "..." | ((this, compiler) => void))[]

Minimizer(s) to use for minimizing the output.

moduleIds?: false | "natural" | "named" | "deterministic" | "size" | "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).

noEmitOnErrors?: boolean

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

nodeEnv?: string | false

Set process.env.NODE_ENV to a specific value.

portableRecords?: boolean

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

providedExports?: boolean

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

realContentHash?: boolean

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

removeAvailableModules?: boolean

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

removeEmptyChunks?: boolean

Remove chunks which are empty.

runtimeChunk?: boolean | "single" | "multiple" | {
    name?: string | Function;
}

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

Type declaration

  • Optional name?: string | Function

    The name or name factory for the runtime chunks.

sideEffects?: 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).

splitChunks?: false | OptimizationSplitChunksOptions

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

usedExports?: 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).

Generated using TypeDoc