Packages

webpack

5.112.2 · 23 Oct 2026MIT76.9M / weekRepositorynpmAtom feed

Your version

5.110.0

27 Aug 2026Where it was published

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__.cw accessors and inline require(), 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 recommends optimization.runtimeChunk. Enable every check not set individually with performance.all, report hints in stats only with performance.hints: "stats", and get them in a stable order that leaves the build hashes unchanged.

  • Add the descriptionRelativePath module rule condition.

  • Add OS-independent glob matching to module rules.

  • Report inner-graph, AMD and bare module bailouts in optimizationBailout.

  • Allow marking externals as side-effect-free with a sideEffects flag.

  • Give externals the original request of a context module element.

  • Add the externalsPresets.nodeModules preset with an allowlist option to externalize installed packages, replacing the webpack-node-externals plugin.

  • Add output.library.umdAmdContainer for an AMD-style loader branch in UMD.

  • Resolve @custom-media values that are true / false or 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 and animation timeline keywords.

  • Derive import defer / import source from the target and fix the source phase.

  • Emit analyzable ESM urls for chunks, assets, styles, workers and wasm.

  • Tree shake CommonJS: module.exports object literals, exports destructured from a require() binding, unused method requires, and unused side-effect-free require() calls and reexports.

  • Resolve relative entry baseUri values and bake one side of a hash cycle.

  • Minify CSS further, only where the document is unchanged: shorthands and box longhands, font-weight, <position> and font-stretch keywords, colors (polar, Lab and hsl() 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, transition layers, display, transforms, gradients, font families, identical repeated declarations, and rules an identical later one makes dead. Abilities are read off the target browsers, vendorPrefixes adds and drops vendor prefixes for them, and rewriteCustomProperties shortens 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.minimize is 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, viewport content, inline <style> and a JSON <script> body through their own grammars. Adds the optimization.minimize.html options collapseWhitespace, mergeStyles, minifyConditionalComments, minifySrcdoc, preserveComments, removeEmptyAttributes, removeEmptyElements, removeImpliedTags, removeRedundantAttributes, sortAttributes and sortTokenLists, 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 shutdown hook to MultiCompiler.

  • Report which compilers changed on the MultiCompiler done hook.

  • Add [containedpath]/[containedfile] placeholders, used for [path]/[file] of asset and html modules with experiments.futureDefaults.

  • Support an object for an entry's html that overrides output.html per 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, arguments or 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.member reading undefined in that case.

  • Warn on cross-kind CSS module export conflicts and let the class win.

  • Add output.resourceHints.dedupe to 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-url external.

  • 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, void keygen and font format detection — and hand back the tree a parsed document was built from when printing it.

  • Clear a Watching's blocked flag 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 ReferenceError from import.meta.main using the wrong module argument.

  • Leave a @namespace URI 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 .webmanifest with a BOM or non-ASCII text.

  • Respect strictThisContextOnImports for require() 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 using and await using declarations in modules.

  • Fix DefinePlugin optional chains reading an undefined object member.

  • Fix MultiCompiler: Compute the common outputPath by 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.globalObject reads this.

  • Run an even-priority __webpack_require__.O handler without waiting.

  • Treat top-level this in 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.js from mdn-data, color-name and the spec IDL — including the value-type facts read out of the CSS value-definition grammars — leaving both syntax.js files algorithm only.

  • Support UNC paths in module and context replacement plugins.

  • Emit less runtime code: shorter syntax where output.environment allows, no IIFE for a RuntimeModule without locals, no unread __webpack_esm_id__ and exports.id chunk 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.