webpack
5.112.2 · 23 Oct 2026MIT76.9M / weekRepositorynpmAtom feed
5.113.0 is the newest release of 5.x.
In short
1 deprecated37 new4 faster47 fixed
- Deprecated
Deprecate the
importMetaContextparser option in favor ofimportMeta.webpackContext.
Release note
Minor Changes
Default
experiments.typescriptto"auto", enabling built-in TypeScript support on Node.js >= 22.6 when no TypeScript loader is registered.Default
experiments.css,experiments.htmlandexperiments.asyncWebAssemblyto"auto", enabling built-in support unless a loader is registered for those files; modules with inline or hook-injected loaders (e.g. html-webpack-plugin templates) keep being parsed as JavaScript.Add
output.resourceHintsto emit resource hints (preload/prefetch/modulepreload/preconnect), on by default for ESM output, plusmodule.parser.<type>.urlHints,css.fontPreloadandjavascript.dynamicImportCssPreload.Add built-in build progress via
infrastructureLogging.progress, plusestimatedTime,phaseTimings, progress barwidthandprogressBar: "auto"onProgressPlugin.Concatenate CommonJS modules with statically analyzable exports; opt out via
optimization.concatenateModules: { commonjs: false }.Wrap "weird" CommonJS modules into module concatenation instead of bailing out.
Add
output.html.inline(true | "script" | "style") and thewebpackInlinemagic comment to inline chunk content into HTML.Add
output.html.injectto control where chunk tags are injected.Add
output.html.title,output.html.metaandoutput.html.baseoptions for head generation.Support per-icon link attributes (
sizes,media,color,type,crossorigin) and arrays inoutput.html.favicon.Add
output.html.manifestto generate and link a web app manifest with hashed icons.Add
output.html.cspto inject a Content-Security-Policy meta with inline-content hashes and an optional nonce.Add the
output.htmlinjectTagscompilation hook to inject tags (script/link/meta/…) withinjectToplacement.Add the
output.htmltransformTagscompilation hook to mutate, remove, or move (between<head>and<body>) a page's existing<script>/<link>/<style>/<meta>tags.Extend the HTML pipeline with
htmllink sources (bundled as their own emitted page) andrel="preload"/"prefetch"links bundled as chunks.Recognize more asset-bearing HTML sources: the
twitter:player:streammeta, legacy SVG references, and Web App Manifesticons/screenshots/shortcutsURLs.Add
module.parser.html.asto parse HTML as a document or an element fragment.Allow disabling a built-in HTML parser source via
type: falseinsources.Export
webpack.html.HtmlModulesPluginwithtransformHtml/htmlEmittedcompilation hooks.Resolve
@custom-media(including media-type values) and@custom-selectorin native CSS.Scope
view-transition-name/-group/-classnames and::view-transition-*()pseudo references in CSS modules undercustomIdents.Add
import.meta.globsupport, with acaseSensitiveoption and consistent hidden/node_modulesmatching.Resolve
import.meta.resolve("./asset")to the emitted asset URL via theimportMeta.resolveparser option.Add
import.meta.envdefaults:MODE,DEV,PROD,SSRandBASE_URL.Add fine-grained
import.metaparser options.- Deprecated
Deprecate the
importMetaContextparser option in favor ofimportMeta.webpackContext. Emit analyzable
new URL(…, import.meta.url), worker/worklet URL andimport()references with literal specifiers for ESM module output.Compile async modules to generators for targets without async/await.
Evaluate and validate the second argument of dynamic
import(specifier, options).Add
module.parser.javascript.workletto bundle WorkletaddModule()entries.Add
?raw,?url,?inlineand?no-inlineasset query suffixes underexperiments.futureDefaults.Add an
interop("default" | "esModule") hint for object externals to control default-export interop.Add an
amd-asyncexternals type that loads AMD externals without an AMD library wrapper.Support
cache.compression: "zstd"for the filesystem cache.Warn on strict-mode-only syntax and semantic hazards in ES module output, configurable via the
strictModeViolationsparser option.Support parsers without location APIs: locations derive from node offsets and AST nodes no longer carry
loc.Attach the original DOM event to
ChunkLoadErrorandScriptExternalLoadErroraserror.event.Add
output.wasmStreamingFallbackfor wasm fallback on a wrong MIME type.Show why a module was marked as not cacheable in stats output.
Expose the active
MultiWatchingonMultiCompiler.watching.Resolve git merge conflicts when parsing the build-http lockfile.
Patch Changes
Fix broken HMR with
output.moduleand non-importchunk loading by emitting a plain-JSON hot-update manifest.Fix unused CSS module exports leaking into the JS wrapper.
Fix deferred import evaluation: re-throw cached errors, guard forcing a still-evaluating module, keep re-exported deferred namespaces identical, and evaluate initial-chunk deferred context imports lazily.
Keep ESM live bindings for a module library's entry exports, including when the runtime is emitted as a separate chunk.
Fix SplitChunks merging undersized modules into the wrong result group.
Fix named id assignment reusing an already-used numbered suffix, which could produce duplicate module/chunk ids.
Fix inlined non-binary asset modules with
encoding: falseemitting "undefined" instead of their content.Decode non-base64 data URIs as UTF-8 so multi-byte characters are preserved.
Keep required JSON data intact when a prototype method (e.g.
arr.includes()) is called on it.Recognize modern RegExp flags (
d,s,u,v) when statically evaluatingnew RegExp(...).Merge object-form and dotted DefinePlugin definitions so
import.meta.env/process.envare consistent across direct, whole-object and destructured access.Emit an error when an object external has no entry for the used externals type.
Fix a persistent cache restore crash when a content section starts exactly on a content-buffer boundary.
Restore missing
internalSerializablesentries (webpack/lib/Module and cold filesystem cache).Fix watch rebuild crash when context symlink targets lack
timestampHash.Fix lazy compilation backend leaking idle module entries and hanging on exit.
Stop logging benign ECONNRESET client errors from the lazy compilation server.
Accept compilations from another webpack copy in
getCompilationHooksagain.Fix
output.htmlinjection edge cases: escaping, head detection, duplicate meta tags, resource-hint/entry-tag retention withinject: false, and stylesheet placement.Ignore a
<base>inside an inert<template>when resolving HTML URLs.Bust an HTML page's
[contenthash]when its inlined chunk content changes.Fix a dangling stylesheet
<link>for a JS-only chunk in an HTML entry.Fix a malformed HTML magic comment leaking a pending
webpackInlinedirective onto the next element.Fix off-by-one dropping the last character of an unterminated
url(...)at end-of-input.Consume the trailing whitespace of a CSS hex escape when unescaping identifiers.
Fix
[fullhash]inoutput.webassemblyModuleFilenameby dropping a stray brace and requesting thegetFullHashruntime module.Fix duplicated errors/warnings in stats output when detail-less entries exceed
errorsSpace/warningsSpace.Improve module parse errors with a babel-style code frame and the module type.
Fix
formatSizerendering sizes of 1 TiB or larger as "undefined".Skip the anonymous default export
.namefix-up whennameis non-configurable, instead of throwing on pre-ES2015 engines.Escape
?and#in context module regexp identifiers so source map names are not truncated.Resolve directory requests to their index module in scoped
DllReferencePlugin.Skip the
hasSymbolcheck in the async module runtime whenenvironment.symbolis set.Use a shared
__webpack_require__.cjshelper for wrapped CommonJS modules.Derive ASI positions from source text instead of acorn's
onInsertedSemicolon, so custom parsers need not collect semicolons.Avoid a second full parse for
autosource type by downgrading module to script in place on a top-level return.Fix exponential-time side-effects analysis on cyclic module graphs by memoizing cycle-free results via Tarjan lowlink.
Speed up JavaScript parsing and AST walking and reduce parser memory usage.
Speed up CSS and HTML parsing and code generation and reduce parser memory usage.
Speed up snapshot creation and reduce its memory usage.
Reduce allocations in JS codegen, concatenation, queues and parser setup.
Speed up stats generation on large builds by reusing the item context across array items.
Memoize loader resolution per compilation to avoid re-resolving the same loader for every matching module.
Reuse and harden webpack's shared resource parser in the loader runner.
Update webpack-sources to 3.5.1 and enhanced-resolve to 5.24.2 to cut peak memory.
Inline the loader-runner package into core.
Fix context hash crash on unsupported directory entries like FIFOs and sockets.
Verify internalSerializables in lint:special and regenerate it in fix:special.
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.