Packages

webpack

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

Your version

5.109.0

23 Jul 2026Where it was published

5.113.0 is the newest release of 5.x.

In short

1 deprecated37 new4 faster47 fixed

  • Deprecated

    Deprecate the importMetaContext parser option in favor of importMeta.webpackContext.

Release note

Minor Changes

  • Default experiments.typescript to "auto", enabling built-in TypeScript support on Node.js >= 22.6 when no TypeScript loader is registered.

  • Default experiments.css, experiments.html and experiments.asyncWebAssembly to "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.resourceHints to emit resource hints (preload/prefetch/modulepreload/preconnect), on by default for ESM output, plus module.parser.<type>.urlHints, css.fontPreload and javascript.dynamicImportCssPreload.

  • Add built-in build progress via infrastructureLogging.progress, plus estimatedTime, phaseTimings, progress bar width and progressBar: "auto" on ProgressPlugin.

  • 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 the webpackInline magic comment to inline chunk content into HTML.

  • Add output.html.inject to control where chunk tags are injected.

  • Add output.html.title, output.html.meta and output.html.base options for head generation.

  • Support per-icon link attributes (sizes, media, color, type, crossorigin) and arrays in output.html.favicon.

  • Add output.html.manifest to generate and link a web app manifest with hashed icons.

  • Add output.html.csp to inject a Content-Security-Policy meta with inline-content hashes and an optional nonce.

  • Add the output.html injectTags compilation hook to inject tags (script/link/meta/…) with injectTo placement.

  • Add the output.html transformTags compilation hook to mutate, remove, or move (between <head> and <body>) a page's existing <script>/<link>/<style>/<meta> tags.

  • Extend the HTML pipeline with html link sources (bundled as their own emitted page) and rel="preload"/"prefetch" links bundled as chunks.

  • Recognize more asset-bearing HTML sources: the twitter:player:stream meta, legacy SVG references, and Web App Manifest icons/screenshots/shortcuts URLs.

  • Add module.parser.html.as to parse HTML as a document or an element fragment.

  • Allow disabling a built-in HTML parser source via type: false in sources.

  • Export webpack.html.HtmlModulesPlugin with transformHtml/htmlEmitted compilation hooks.

  • Resolve @custom-media (including media-type values) and @custom-selector in native CSS.

  • Scope view-transition-name/-group/-class names and ::view-transition-*() pseudo references in CSS modules under customIdents.

  • Add import.meta.glob support, with a caseSensitive option and consistent hidden/node_modules matching.

  • Resolve import.meta.resolve("./asset") to the emitted asset URL via the importMeta.resolve parser option.

  • Add import.meta.env defaults: MODE, DEV, PROD, SSR and BASE_URL.

  • Add fine-grained import.meta parser options.

  • Deprecated

    Deprecate the importMetaContext parser option in favor of importMeta.webpackContext.

  • Emit analyzable new URL(…, import.meta.url), worker/worklet URL and import() 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.worklet to bundle Worklet addModule() entries.

  • Add ?raw, ?url, ?inline and ?no-inline asset query suffixes under experiments.futureDefaults.

  • Add an interop ("default" | "esModule") hint for object externals to control default-export interop.

  • Add an amd-async externals 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 strictModeViolations parser option.

  • Support parsers without location APIs: locations derive from node offsets and AST nodes no longer carry loc.

  • Attach the original DOM event to ChunkLoadError and ScriptExternalLoadError as error.event.

  • Add output.wasmStreamingFallback for wasm fallback on a wrong MIME type.

  • Show why a module was marked as not cacheable in stats output.

  • Expose the active MultiWatching on MultiCompiler.watching.

  • Resolve git merge conflicts when parsing the build-http lockfile.

Patch Changes

  • Fix broken HMR with output.module and non-import chunk 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: false emitting "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 evaluating new RegExp(...).

  • Merge object-form and dotted DefinePlugin definitions so import.meta.env/process.env are 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 internalSerializables entries (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 getCompilationHooks again.

  • Fix output.html injection edge cases: escaping, head detection, duplicate meta tags, resource-hint/entry-tag retention with inject: 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 webpackInline directive 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] in output.webassemblyModuleFilename by dropping a stray brace and requesting the getFullHash runtime 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 formatSize rendering sizes of 1 TiB or larger as "undefined".

  • Skip the anonymous default export .name fix-up when name is 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 hasSymbol check in the async module runtime when environment.symbol is set.

  • Use a shared __webpack_require__.cjs helper 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 auto source 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.