Packages

webpack

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

Your version

5.108.0

25 Jun 2026Where it was published

5.113.0 is the newest release of 5.x.

In short

1 security40 new10 faster61 fixed

  • Security

    Reject __proto__, constructor and prototype path segments in cli.processArguments to prevent prototype pollution.

Release note

Minor Changes

  • Treat top-level await and import.meta as ES module markers, matching Node.js syntax detection so no explicit module type is needed.

  • Add a bun target that emits ESM and externalizes bun:* and node.js built-in modules.

  • Support CommonJS reexports via Object.defineProperty value and getter descriptors.

  • Support JSON Schema const when generating CLI flags from a schema.

  • Support JSON Schema if/then/else when generating CLI flags from a schema.

  • Skip import specifiers, require() and import() calls in dead conditional branches gated by inlined imported constants (isDEV ? A : B), evaluated via getCondition.

  • CSS localIdentName [hash] now resolves to the local ident hash (matching css-loader); use [modulehash] for the module hash.

  • Add CSS parser as option and resolve url() inside HTML style attributes.

  • Add dedicated module classes for all built-in module types.

  • Support .html/.css for the default ./src entry under the html/css experiments.

  • Add defineConfig helper for typed configuration files.

  • Add a deno target (with versions, e.g. deno, deno2, deno1.40) that emits ESM, resolves node.js built-ins via the required node: specifier, and keeps Deno's own import protocols (npm:, jsr:, node:, http(s)://) external.

  • Use module-import for electron externals when the target supports ESM.

  • Add output.environment.logicalAssignment to emit ||= in runtime code when the target supports logical assignment operators.

  • Resolve and rewrite asset URLs inside <iframe srcdoc> in HTML modules.

  • Add HMR support for HTML modules with body/title DOM patching on update.

  • Add css-url html source type extracting url() references from CSS-valued attributes.

  • Add module.parser.html.sources option to disable or customize URL-attribute extraction for HTML modules, with script / script-module / stylesheet / stylesheet-inline types for custom attributes

  • Add module.parser.html.template option to transform HTML module source before parsing.

  • Extract more source URLs in HTML modules (SVG, legacy and obsolete attributes).

  • Inline export default <const> when the default-exported value is a primitive constant.

  • Support optimization.inlineExports for better tree-shaking.

  • Re-encode inline hash digests ([contenthash]/[chunkhash]/[fullhash]/[modulehash]) from the full content hash, so they carry full entropy and work under optimization.realContentHash and in dynamically-loaded chunk filenames; also preserve leading zero bytes in base-N digests.

  • Allow tree-shaking unused calls to /*#__NO_SIDE_EFFECTS__*/-annotated (pure) exports across module boundaries.

  • Defer building unused re-export targets of side-effect-free barrel modules.

  • Keep export mangling enabled for modules whose namespace object is used as a whole value, by materializing a decoupled namespace object that keeps the original export names.

  • Add output.environment.let option (paired with target's let capability) and emit let/const instead of var in generated runtime code wherever it is safe. Bindings that may be wrapped in runtime-condition if blocks (harmony imports, ConcatenatedModule external imports) continue to use var to preserve function scoping.

  • Add output.html to emit an HTML file per entrypoint, injecting its JS/CSS chunks (including dependOn shared chunks).

  • Add module.parser.javascript.pureFunctions to mark top-level names as side-effect-free for tree shaking.

  • Add universal to compiler.platform, true for universal targets ("universal" or ["web", "node"]).

  • Add output.strictModuleResolution to gate the runtime MODULE_NOT_FOUND guard.

  • Support an inline digest in hash path placeholders, e.g. [contenthash:base64:8].

  • Support [uniqueName] and its [uniquename] alias in template paths.

  • Support CSS in Node for universal targets, collecting styles for SSR.

  • Improve commonjs, node-commonjs and global externals for universal targets.

  • Add a universal target preset (browser + web worker + Node.js + Electron + NW.js) that always outputs ECMAScript modules.

  • Support new Worker(new URL(...)) in universal (node + web) targets by resolving the Worker constructor from worker_threads when no global Worker exists.

  • Add output.workerChunkFilename and entry.worker for worker chunk filenames.

Patch Changes

  • Skip re-parsing the inlined entry module when no renaming is needed.

  • Extend the avoidEntryIife no-parse fast path to multi-entry chunks.

  • Reuse the binary deserialize dispatch table to speed up cache restore.

  • Type buildInfo and buildMeta per module type with shared common properties.

  • Avoid copying module runtime requirements when ownership is not transferred.

  • Keep all CommonJS exports when an exported function accesses them via this.

  • Align CLI color-support detection across Node, Deno and Bun.

  • Include the schema origin path in conflicting-schema CLI argument errors.

  • Security

    Reject __proto__, constructor and prototype path segments in cli.processArguments to prevent prototype pollution.

  • Speed up Compilation.deleteAsset and Compilation.renameAsset via a lazy reverse index from asset file name to containing chunks.

  • Fix merging of inner modules' top-level declarations in concatenated modules.

  • Reduce allocations in export hashing and concatenation name lookups.

  • Avoid toLowerCase allocations in CSS keyword comparisons.

  • Speed up CSS identifier escaping with a char-class lookup table.

  • Resolve [fullhash] in url() public paths for inlined CSS export types (style/text/css-style-sheet) at runtime.

  • Avoid quadratic line scan when building CSS module exports source maps.

  • Compute CSS comment source locations lazily.

  • Support inline hash digest and length in CSS module localIdentName placeholders.

  • Resolve full CSS escapes (including hex) in CSS-Modules names, so e.g. \75 rl() matches url().

  • Reduce CSS parser CPU (hoisted per-call regexes, byte-compared @container pure-mode keywords) and stop retaining parsed comments on the reused parser instance between modules.

  • Reduce CSS build time and memory usage. Per-export CSS dependencies are consolidated into one dependency per module, and hot-path allocations and lookups in CSS code generation and the module-graph cache are trimmed.

  • Cache CSS public-path placeholder offsets per module source to avoid re-materializing and re-scanning the source on every render.

  • Fix CSS tokenizer infinite loops and dropped tokens on malformed input.

  • Speed up CSS identifier unescaping with bulk run flushing.

  • Skip already-visited symlink targets when resolving context hashes so cyclic symlink graphs no longer overflow the queue.

  • Resolve DefinePlugin access to an undefined object member as undefined.

  • Avoid materializing dependency source locations when sorting, keeping them lazy to reduce build time and memory.

  • Speed up serialization deserialize by replacing a Buffer.isBuffer call with a typeof check.

  • Emit assets with absolute target paths as-is to avoid invalid Windows paths.

  • Add output.environment.spread, output.environment.hasOwn, and output.environment.symbol, and use method shorthand, spread, Object.hasOwn, and an unguarded Symbol in generated runtime code where the environment supports it.

  • Drop the unused loadScript runtime from ESM hot-update bundles.

  • Extend value binding optimization to export default expressions.

  • Reduce ExportInfo memory and cache size for inline-exports metadata.

  • Resolve nested exports info paths iteratively to cut per-level array allocations.

  • Fix stale incremental cache for css, html and asset/source/inline modules.

  • CommonJS tree-shaking no longer drops exports accessed before a deferred require binding.

  • Make CSS-referenced asset available in lazy JS chunk during incremental rebuilds.

  • Correct string/template import specifier parsing for filesystem cache build dependencies and fix module-sharing hostname validation.

  • Guard isDeferred() behind experiments.deferImport in ConcatenatedModule

  • Speed up deterministicGrouping and cached comparators on large builds.

  • Reduce allocations on harmony/commonjs dependency hot paths.

  • Force-load a module's new owning chunk during HMR when its only loaded chunk is removed from a runtime, so it keeps receiving updates.

  • Fix HTML parser adoption agency to handle a nobr shielded by a marker.

  • Expand HTML parser tag/attribute coverage and decode character references.

  • Speed up and reduce allocations in the experimental HTML parser's tokenizer, tree builder, and entity decoder.

  • Speed up the experimental HTML parser and reduce its memory usage.

  • Avoid redundant HTML module work: reuse the dependency-template render across the JS and HTML code-generation passes, and memoize sentinel resolution/content hashing per source.

  • Release inner-graph state after use and speed up inlined-export checks.

  • Reduce JavascriptParser allocations on the walk hot path to speed up parsing and lower memory usage.

  • Reduce CPU and memory overhead of the lazy barrel optimization.

  • Keep the error message in module build errors on engines whose Error.stack omits it.

  • Speed up module concatenation by caching repeated per-module computations.

  • Move the hot flag from Module to NormalModule, where it's actually read and written.

  • Move the weak flag from Dependency to ModuleDependency, where it's actually set.

  • Avoid the entry IIFE for multiple inlined entry modules by renaming collisions.

  • Reject new import.defer(...)/new import.source(...) with member access as a SyntaxError.

  • Avoid ProvidePlugin injection for local CommonJS require bindings that use the same variable name.

  • Resolve the global new Worker(new URL(...)) to worker_threads on the node target.

  • Use optional chaining in generated runtime code where the environment supports it.

  • Allow output.path to be the filesystem root by treating EISDIR like EEXIST in mkdirp.

  • Reduce memory by not retaining the source location object on every dependency.

  • Keep the full exports object when a require() binding is re-exported.

  • Replace glob-to-regexp dependency with watchpack's globToRegExp utility.

  • Shrink the persistent cache: add a NULL_AND_I16 binary tier and inline tiny strings instead of larger far back-references.

  • Type serializer read/write contexts with positional tuples and fix a ProvideSharedDependency version/request swap.

  • Speed up buildChunkGraph by deriving block modules from the first runtime.

  • Cache re-export target resolution in SideEffectsFlagPlugin for faster builds.

  • Skip pure single-star passthrough modules for export * re-exports.

  • Skip dependency error/warning reporting for unchanged modules on rebuilds.

  • Use value descriptors instead of getters for const export bindings.

  • Apply CSS hot updates on the Node side of a universal target.

  • Guard CSS style export-type injection so it no-ops when there is no document.

  • Avoid building warning stats objects when counting warnings without a filter.

  • Recognize forward-slash Windows absolute paths (e.g. C:/dir) consistently.

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.