Packages

webpack

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

Your version

5.112.0

15 Oct 2026Where it was published

5.113.0 is the newest release of 5.x.

Summary· from the note as AI read it

Migration neededRead before upgrading: 3 changes to make.

Before you upgrade

  • Update css.syntax/html.syntax uses to parser, printer, SourceProcessor
  • Upgrade minimizer-webpack-plugin to 5.12 or laterTo check
  • Re-run typecheck; any/object/Function types replaced with stricter ones

Deprecated

  • Import moved exports and plugins from their new scopes
  • Replace Harmony* names with their ESM* equivalents

New

  • Apply plugins set on a multi-configuration array to the MultiCompiler.
  • Add optimization.minimize.css.dropOverriddenDeclarations, dropping a declaration a later one overrides where no target is named.
  • Let util.makeSerializable take several requests, current one first.
  • Emit the source map scopes field, so a debugger resolves imported ESM bindings by name.
  • Add library.entryExports: "all" to expose the exports of every entry module.

In short

3 breaking2 deprecated25 new21 faster79 fixed6 internal

  • Breaking

    Reduce css.syntax/html.syntax to parser, printer, SourceProcessor with one node path.

  • Breaking

    Require minimizer-webpack-plugin 5.12, so inline scripts in HTML minify again.

    To check
  • Breaking

    Match urlHints rules written with and, or, not and glob conditions; profile hook map taps, such as resolver and parser hooks, in ProfilingPlugin; report import.meta option errors inside require.ensure callbacks, not crash; and replace any, object and Function with precise types in the type definitions.

  • Deprecated

    Export more plugins under their scope, move eleven loose exports under theirs, deprecate the old, and expose template.DependencyTemplate, module.NullFactory and util.makeSerializable.

  • Deprecated

    Rename the Harmony* names to ESM* and deprecate the old spellings.

Release note

Minor Changes

  • Apply plugins set on a multi-configuration array to the MultiCompiler.

  • Add optimization.minimize.css.dropOverriddenDeclarations, dropping a declaration a later one overrides where no target is named.

  • Deprecated

    Export more plugins under their scope, move eleven loose exports under theirs, deprecate the old, and expose template.DependencyTemplate, module.NullFactory and util.makeSerializable.

  • Let util.makeSerializable take several requests, current one first.

  • Emit the source map scopes field, so a debugger resolves imported ESM bindings by name.

  • Add library.entryExports: "all" to expose the exports of every entry module.

  • Recognize a required const binding assigned to exports as a re-export.

  • Accept glob patterns in more path, module and file filter options.

  • Bundle a run of inline <script> tags into one chunk the page can inline.

  • Add module.parser.javascript.topLevelThis for classic-script this semantics.

  • Add module.parser.html.chunkName and a webpackChunkName comment for tags.

  • Add include/exclude version and request filters to shared modules.

  • Keep module side-effect information in ESM output as PURE annotations.

  • Add optimization.splitChunks.dedupDepth to discover chunk intersections.

  • Add optimization.minimizeOptions.json, on by default with futureDefaults.

  • Add SSRManifestPlugin and fix server-rendered CSS collection and adoption.

  • Add an ignore hook to output.copy and keep unfollowed from symlinks.

  • Add optimization.minimize.css.convertApproximateColors.

  • Add XML parsing and SVG/XML minification with data URLs and attribute sorting.

  • Extract CSS/HTML license comments like JS and safely shorten CSS gradients.

  • Resolve an async DefinePlugin.runtimeValue over an async beforeParse hook.

  • Add CSS customMedia/customSelectors minimize options; resolve chained names.

  • Deprecated

    Rename the Harmony* names to ESM* and deprecate the old spellings.

  • Reduce css.syntax/html.syntax to parser, printer, SourceProcessor with one node path.

  • Add a JavaScript SyntaxTree read like the CSS one, and toEstreeObject.

  • Fix minified code that threw, and add pure_conversions and pure_heritage.

  • Shorten more CSS values and selectors, fold longhands, order declarations and gather layer blocks.

  • Add optimization.minimize.css.charset; false drops @charset for UTF-8 CSS.

Patch Changes

  • Join rules a gathered @layer leaves adjacent, and an at-rule with a later one
    stating the same condition; read what a condition declares.

  • Read escaped CSS names and functions as spelled, and minify them unescaped.

  • Minify JavaScript, CSS and HTML assets whose names carry a #fragment.

  • Breaking

    Require minimizer-webpack-plugin 5.12, so inline scripts in HTML minify again.

  • Minify the attributes of an HTML tag without rewriting the template in it.

  • Order joined at-rule selector lists and gather a repeated large @layer block.

  • Preserve case-sensitive template identifiers when minifying HTML tag attributes.

  • Match Acorn's strict directives, Unicode identifiers and expression validation.

  • Skip concatenating modules when optimization.providedExports is disabled.

  • Join rules a nesting lowering or duplicate drop left for a second pass.

  • Write U+00A0 in a minified HTML attribute as the character, not .

  • Escape a foreign <script> or <style> body, which is character data.

  • Name the runtime module whose generation fails while hashing.

  • Rebuild a module in watch when its missing unused dependencies swap.

  • Rebuild in watch mode when a file is deleted while a build is running.

  • Read a foreign <script> or <style> body as character data, not as raw text.

  • Keep an inline <style> body as written when rebuilding a page webpack emitted.

  • Fix minified HTML for style spellings, CSS quotes, <noscript> and a BOM.

  • Record a build dependency required through a spread on Bun.

  • Write a nested selector opening on a combinator against its parent the way the printer writes one.

  • Fix missing async stylesheets with a shared runtime.

  • Support deferred imports introduced by hot updates.

  • Fix trailing commas in require.resolve() and require.resolveWeak() calls.

  • Keep regular expressions, functions and plugins distinct in resolver caches.

  • Order the list a lowered nested selector lands in on what is written, not on what was.

  • Hoist a vendor-prefixed nested rule for a target that reads no nesting.

  • Name a hoisted nested rule in the dark-scheme copy it writes.

  • Minify data: URL payloads in HTML attributes and new URL, and web manifests.

  • Fold a fallback's colors over the author's arguments, and print with
    recurseBlocks: false rather than throwing

  • Read a regular expression repeating a capture group name in linear time.

  • Make lazy barrels defer import declarations and keep no deferral across compilations.

  • Invalidate unaffected caches when connection activity or async status changes.

  • Order concatenated re-exports deterministically when their source order ties.

  • Regenerate a module's exports when a require() cycle forms or breaks around it.

  • Recompute re-exports, code and warnings when a module goes missing or returns.

  • Preserve loader resolution dependencies across cached rebuilds.

  • Read unwatched changes afresh and wait for restarted watch compilers to finish.

  • Parse loader output for .wasm as JavaScript when async wasm is auto-enabled.

  • Remove modules an async chunk inherits from a named parent chunk grown later.

  • Fix JavaScript minifier crashes, altered behavior, lost comments, unparsable output and null source map sources, including parameter aliases, ESTree trees and preserved names, and stop it writing into the caller's parse options.

  • Preserve the source phase of dynamic WebAssembly import contexts.

  • Await every async entry before resolving an ESM library import.

  • Keep unknown import.meta properties per module, alike for aliases and direct use.

  • Return WebAssembly modules directly from eager and weak source imports.

  • Handle missing ESM hot update manifests in Node.js without failing HMR checks.

  • Speed up JavaScript parsing: comment lookup, the tokenizer and the grammar.

  • Prefix and drop 2009 flexbox names, keeping them where a box lays out by them.

  • Keep initial where Gecko or WebKit reads the property's keyword apart.

  • Fold calc() as lightningcss does, keeping it where a bare value is refused.

  • Keep a color-mix() whose hue rests on a gray's conversion residue.

  • Keep a shorthand's initial keyword where it parts two keywords of another slot.

  • Group lib/ and lib/dependencies/ sources into directories.

  • Treat a browserslist target given at a bare major version (e.g. safari 10) as <major>.0 when a feature's first supported version is a [major, minor] pair, so it is no longer reported as unsupported.

  • Keep the last HMR update with output.clean; stop rechecking removed files.

  • Read and print a CSS backslash as the spec does, and a NUL as U+FFFD.

  • Make minified CSS and HTML stable on a second pass, even for truncated input.

  • Minify a merged <style> run as one sheet, closing each where its input ended.

  • Minify JavaScript with webpack's printer under futureDefaults, terser otherwise.

  • Preserve wrappedContextRegExp flags when rebuilding context request matchers.

  • Minify CSS @supports, @import and @custom-media conditions, and exponent numbers.

  • Fold unitless hsl()/hwb() channels, and only where the separators are valid.

  • Split @value imports on the from keyword, not a substring in the path.

  • Destructure a dotted DefinePlugin key whose value is falsy or a runtimeValue.

  • Make Stats.hasErrors() read errors through the processErrors hook (via getErrors()), matching hasWarnings(), so a plugin that filters errors out of the hook is no longer contradicted by hasErrors().

  • Allow wrapping an external concatenated module, now asked of the module itself, and re-exporting a JSON or asset default as a namespace object.

  • Match urlHints rules written with and, or, not and glob conditions; profile hook map taps, such as resolver and parser hooks, in ProfilingPlugin; report import.meta option errors inside require.ensure callbacks, not crash; and replace any, object and Function with precise types in the type definitions.

  • Reduce CSS and HTML build time and memory allocation.

  • Reuse free names instead of re-parsing modules for the entry IIFE rename.

  • Release each module's ast once scope-analysed, and encode each export path once.

  • Export a module library entry's default expression as its own binding, and keep
    the export helpers where the entry is not inlined.

  • Give a wrapped concatenated body the same function header as a module factory.

  • Skip reading every asset when no content hash is named.

  • Cut graph, cached set, lazy barrel and ESM import memory and allocations.

  • Stop a module source from being held as both a string and a buffer.

  • Read the browserslist data and options schema only when a build needs them.

  • Release the eval devtool's cached module sources after wrapping them.

  • Release the rendered module sources after emitting the chunks.

  • Cut the peak memory and time of minifying through webpack's printer.

  • Shrink minified JS: unwrap IIFEs, fold calls, drop dead code, split arrays.

  • Cut JavaScript minifier time and memory; keep token positions in large inputs.

  • Keep the calc() around a steps() count jump-none would reject bare.

  • Split the CSS syntax module into a parser file and a printer file.

  • Split the HTML syntax module into a parser file and a printer file.

  • Rename classes in lib/ so each says what it does and no two share a name.

  • Keep the remote fallback index aligned with registered container externals when an internal external precedes a real one.

  • Stop a minified inlined chunk leaving a doubled ; in its <script>.

  • Stop mergeDistantRules mangling rules or reordering all, and merge more.

  • Minify by parsing with webpack's own parser rather than terser's.

  • Read JavaScript with webpack's parser alone when minifying, refusing early errors.

  • Parse an assert(...) call after an import with no semicolon, and a regular expression after yield in a generator method.

  • Keep the private names a direct eval reads when mangling.

  • Keep a class dropped for its effects where they read a private name it declares.

  • Parenthesize the right side of a private in, a yield, await, private in or optional chain tagging a template, and a let or async starting a statement or loop head, where the minifier printed code that no longer parsed or read otherwise.

  • Keep a name a parameter list or catch parameter reads from resolving to what the function body or catch block declares, which the minifier renamed or dropped as unused.

  • Scope and export a CSS Modules @value the same way whether local or imported.

  • Keep CSS border: none and gradient fallbacks for units a target cannot read.

  • Keep minified CSS safe for older browsers; drop dead fallbacks and overrides.

  • Keep CSS rules apart from a neighbor whose selector no browser parses.

  • Keep an :nth-*() argument with a space after its sign as written.

  • Keep minified CSS readable by browsers the compat data does not cover.

  • Keep a module its chunk still needs after compilation.rebuildModule().

  • Keep a CSS rule nested under a selector opening on a combinator when lowering.

  • Use module paths for webpack's built-in minimizers so parallel minification can load them directly in workers instead of serializing their function sources.

  • Keep stats from an earlier build readable after a later build no longer has one of their modules.

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.