webpack
5.112.2 · 23 Oct 2026MIT76.9M / weekRepositorynpmAtom feed
5.113.0 is the newest release of 5.x.
In short
32 new1 faster32 fixed
Release note
Minor Changes
Wrap concatenated modules in lazy
__webpack_require__.cwaccessors and inlinerequire(), keeping a wrapped body's names and side effects intact.Add performance hints reporting what a build costs: duplicate packages and modules, circular dependencies, broad contexts, large modules and chunks, hotspots,
eval, missing PURE annotations, polyfills, redundant dynamic imports, OS-dependent rules, cache effectiveness, how chunks load, what splitting refused, why an optimization was skipped, and rules, defines, externals, aliases and barrel reexports nothing uses. An oversized asset names its largest modules, and an entrypoint carrying the runtime recommendsoptimization.runtimeChunk. Enable every check not set individually withperformance.all, report hints in stats only withperformance.hints: "stats", and get them in a stable order that leaves the build hashes unchanged.Add the
descriptionRelativePathmodule rule condition.Add OS-independent
globmatching to module rules.Report inner-graph, AMD and bare
modulebailouts inoptimizationBailout.Allow marking externals as side-effect-free with a
sideEffectsflag.Give externals the original request of a context module element.
Add the
externalsPresets.nodeModulespreset with anallowlistoption to externalize installed packages, replacing thewebpack-node-externalsplugin.Add
output.library.umdAmdContainerfor an AMD-style loader branch in UMD.Resolve
@custom-mediavalues that aretrue/falseor name another custom media.Add the
__webpack_css_server_styles__module variable to read the CSS collected while rendering without a DOM, and keep that CSS in the order the styles were applied.Patch the HTML
<head>in place on hot update instead of forcing a full reload, including when a<script>that never executed is removed.Scope counter names in CSS modules; fix the
counter()counter-style andanimationtimeline keywords.Derive
import defer/import sourcefrom the target and fix the source phase.Emit analyzable ESM urls for chunks, assets, styles, workers and wasm.
Tree shake CommonJS:
module.exportsobject literals, exports destructured from arequire()binding, unused method requires, and unused side-effect-freerequire()calls and reexports.Resolve relative entry
baseUrivalues and bake one side of a hash cycle.Minify CSS further, only where the document is unchanged: shorthands and box longhands,
font-weight,<position>andfont-stretchkeywords, colors (polar, Lab andhsl()converted to hex), numbers, times, zero units,calc()and every math function the spec names folded over constants, selector lists, An+B, keyframe selectors, media-feature ranges,unicode-range,transitionlayers,display, transforms, gradients, font families, identical repeated declarations, and rules an identical later one makes dead. Abilities are read off the target browsers,vendorPrefixesadds and drops vendor prefixes for them, andrewriteCustomPropertiesshortens custom property values. Minification never changes whether a declaration parses, and beautifying keeps every rule.Safely minify CSS (with source maps) and HTML assets when
optimization.minimizeis enabled, unless a minimizer is already configured for them, making only transformations an engine cannot tell apart. Every rewrite is named as an option, so it can be switched off.Minify HTML further where the parsed document is unchanged: drop redundant quotes, whitespace nothing renders, escapes text does not need, implied tags, optional end tags nothing prints behind, empty attributes and nested empty elements; fold enumerated values and casing; normalize each attribute against the element it is on; and rewrite
style, token lists,srcset,sizes, URL, integer and boolean attributes, viewportcontent, inline<style>and a JSON<script>body through their own grammars. Adds theoptimization.minimize.htmloptionscollapseWhitespace,mergeStyles,minifyConditionalComments,minifySrcdoc,preserveComments,removeEmptyAttributes,removeEmptyElements,removeImpliedTags,removeRedundantAttributes,sortAttributesandsortTokenLists, and keeps an end tag the parent, the next element or the adoption agency would otherwise restructure the tree over.Suggest the closest name or a casing fix anywhere in a failed request.
Add aggregated
shutdownhook toMultiCompiler.Report which compilers changed on the MultiCompiler
donehook.Add
[containedpath]/[containedfile]placeholders, used for[path]/[file]of asset and html modules withexperiments.futureDefaults.Support an object for an entry's
htmlthat overridesoutput.htmlper option.Configure or exclude each asset type's minifier via
optimization.minimize.Support printing CSS and HTML beautified as well as minified.
Add
renderEmbeddedSource, and minify what it offers out of the box.Report bindings named
eval,argumentsor reserved words in ES module output.Emit no development source map for module libraries, or any with futureDefaults.
Speed up builds and cut memory: faster CSS, HTML and JavaScript parsing and minification, a built-in scope analyzer replacing
eslint-scope, faster dependency hot paths, module diagnostics, CommonJS export scanning and concatenated module renaming, runtime modules, parsers, generators and dependencies loaded only when used, one file watcher pool shared between MultiCompiler children, and lower parser, graph and startup memory.Improve tree-shaking for a namespace reexported as default, and fix
import d from "./mod"; d.memberreadingundefinedin that case.Warn on cross-kind CSS module export conflicts and let the class win.
Add
output.resourceHints.dedupeto skip prefetch links for already preloaded/prefetched chunks.
Patch Changes
Let a memory-cache etag mismatch fall through to the file cache instead of reporting a miss.
Determine provided exports in dependency order, so a build's module hashes no longer depend on what the persistent cache held.
Emit no dead module and no failing require for an
asset-urlexternal.Fix names, hidden devtools and cache reuse for CSS maps inlined into JS.
Follow the HTML spec more closely when parsing and printing: frameset content, quirks paragraphs and selects,
<![CDATA[outside foreign content as a bogus comment,<?target data?>as a processing instruction,</>dropped, comment data and DOCTYPE identifiers read from the tokenizer states, attributes merged from a repeated<html>/<body>tag, legacy JavaScript script types, voidkeygenand font format detection — and hand back the tree a parsed document was built from when printing it.Clear a
Watching'sblockedflag when its build starts, so it reports only a child actually waiting for its MultiCompiler parent.Fix AMD
define()output using the wrong module and exports argument names.Fix
ReferenceErrorfromimport.meta.mainusing the wrong module argument.Leave a
@namespaceURI alone instead of resolving and rewriting it as an asset.Resolve escaped CSS names, and scope a grid area cell name as one name.
Track exports usage of side-effect-free modules an active import() evaluates.
Resolve absolute symlink targets and treat an unreadable context as missing.
Fix corrupted icon URLs in a
.webmanifestwith a BOM or non-ASCII text.Respect
strictThisContextOnImportsforrequire()member calls.Fix
import.meta,[object Object]asset urls and crashes in build-time executed modules.Inherit sideEffects past a type-only nested package.json for files under node_modules.
Do not fail directory creation when the file system reports it already exists.
Fix top-level
usingandawait usingdeclarations in modules.Fix
DefinePluginoptional chains reading an undefined object member.Fix MultiCompiler: Compute the common
outputPathby whole path segments, run again after a dependency validation failure, and recover watch mode from a fatal child error without leaking watchings.Keep a nested bundle's runtime tables separate when bundling webpack output.
Keep the runtime out of strict mode when
output.globalObjectreadsthis.Run an even-priority
__webpack_require__.Ohandler without waiting.Treat top-level
thisin a classic worker entry as its global scope.Rehash runtime modules whose code changes under a content-named filename.
Fix namespace object reexports and string export names in module library output and emit a CommonJS entry's default as
export default.Keep tree-shaken JSON arrays as arrays when a prototype property is read.
Generate every CSS and HTML lookup table into
lib/{css,html}/data.jsfrommdn-data,color-nameand the spec IDL — including the value-type facts read out of the CSS value-definition grammars — leaving bothsyntax.jsfiles algorithm only.Support UNC paths in module and context replacement plugins.
Emit less runtime code: shorter syntax where
output.environmentallows, no IIFE for aRuntimeModulewithout locals, no unread__webpack_esm_id__andexports.idchunk exports, and an ESM entry chunk installing its own modules from its local bindings instead of importing itself.Release the compilation and file system caches retained after
compiler.close().
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.