Skip to content

Releases: webpack/webpack

v5.112.2

Choose a tag to compare

@github-actions github-actions released this 23 Oct 12:13
e95a7f2

Patch Changes

v5.112.1

Choose a tag to compare

@github-actions github-actions released this 22 Oct 23:45
759b539

Patch Changes

  • Rebuild a lazy barrel in watch when what it defers changes, and keep the imports and re-exports it still runs. (by @aryanraj45 in #22699)

  • Rebuild under cacheUnaffected a module whose re-export target goes or returns. (by @aryanraj45 in #22749)

  • Fix "Self-reference dependency has unused export name" for CommonJS namespace re-exports. (by @alexander-akait in #22791)

  • Fix exportType: "style" CSS modules throwing outside the runtime chunk. (by @lazerg in #22833)

  • Fix crash when a CSS module with exportType: "style" imports an ignored stylesheet. (by @codeXsidd in #22846)

  • Keep empty process environment variables that .env files don't define in DotenvPlugin. (by @alexander-akait in #22794)

  • Rehash an ESM entry chunk when a chunk it imports by file name changes. (by @alexander-akait in #22804)

  • Handle a NUL inside an HTML CDATA section the way the parsing spec does. (by @dependabot in #22811)

  • Keep module exports live across chunks, runtimes, HMR and eval, sparing globals. (by @alexander-akait in #22733)

  • Await asynchronous modules that ProvidePlugin injects into ES modules. (by @alexander-akait in #22728)

  • Keep a resolve that ends after the compiler closed from throwing. (by @alexander-akait in #22795)

  • Preserve string names passed to SharedWorker constructors. (by @bjohansebas in #22770)

  • Preserve string contents when extracting source map comments. (by @bjohansebas in #22768)

  • Scope strict-mode, async and generator block function declarations to their block. (by @alexander-akait in #22800)

  • Preserve raw dotenv values when reusing cached environment files. (by @Eshiv-Pandey in #22787)

  • Preserve assigned or patched built-ins, conversions and pattern targets. (by @aryanraj45 in #22761)

  • Keep globals a globalThis write replaces, and slice on a patched array. (by @alexander-akait in #22862)

  • Skip HTML script tags for shared chunks that emit no JavaScript. (by @bjohansebas in #22779)

  • Keep the digits Firefox lays out a minified CSS percentage with. (by @alexander-akait in #22718)

  • Reject a second srcset descriptor after a 0x density descriptor. (by @alexander-akait in #22741)

  • Minify JavaScript faster, folding string methods on constants and x -= 1. (by @alexander-akait in #22823)

  • Shorten minified JavaScript, and keep it running like its source. (by @alexander-akait in #22717)

  • Drop more unused functions, arguments, calls, global reads and variable copies when minifying JavaScript. (by @alexander-akait in #22789)

  • Minify JavaScript smaller where swc does, and fold a function's length right. (by @alexander-akait in #22826)

  • Reduce JavaScript output size where oxc or swc produce smaller output. (by @alexander-akait in #22829)

  • Update watchpack to 2.6.3 and rebuild on a node_modules created mid-build. (by @alexander-akait in #22743)

  • Support concatenateModules with cacheUnaffected. (by @alexander-akait in #22746)

  • Update schema-utils to 4.8.1. (by @alexander-akait in #22774)

  • Keep CSS fallbacks, vendor overrides, oklch() hues and HTML elements. (by @alexander-akait in #22753)

  • Validate CleanPlugin and DotenvPlugin options with a precompiled check, so valid options no longer compile their schema at startup. (by @alexander-akait in #22758)

  • Speed up startup and CSS minification, sharing the compile cache with workers. (by @xiaoxiaojx in #22706)

  • Use precise, generic types for modules, parsers, generators, stats and loaders. (by @alexander-akait in #22731)

v5.112.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 22:22
755c49e

Minor Changes

  • Apply plugins set on a multi-configuration array to the MultiCompiler. (by @alexander-akait in #22702)

  • Add optimization.minimize.css.dropOverriddenDeclarations, dropping a declaration a later one overrides where no target is named. (by @alexander-akait in #22175)

  • Export more plugins under their scope, move eleven loose exports under theirs, deprecate the old, and expose template.DependencyTemplate, module.NullFactory and util.makeSerializable. (by @alexander-akait in #22261)

  • Let util.makeSerializable take several requests, current one first. (by @alexander-akait in #22340)

  • Emit the source map scopes field, so a debugger resolves imported ESM bindings by name. (by @alexander-akait in #21999)

  • Add library.entryExports: "all" to expose the exports of every entry module. (by @alexander-akait in #22235)

  • Recognize a required const binding assigned to exports as a re-export. (by @hai-x in #22276)

  • Accept glob patterns in more path, module and file filter options. (by @hai-x in #22422)

  • Bundle a run of inline <script> tags into one chunk the page can inline. (by @alexander-akait in #22188)

  • Add module.parser.javascript.topLevelThis for classic-script this semantics. (by @alexander-akait in #22193)

  • Add module.parser.html.chunkName and a webpackChunkName comment for tags. (by @alexander-akait in #22200)

  • Add include/exclude version and request filters to shared modules. (by @alexander-akait in #22297)

  • Keep module side-effect information in ESM output as PURE annotations. (by @alexander-akait in #21789)

  • Add optimization.splitChunks.dedupDepth to discover chunk intersections. (by @alexander-akait in #22240)

  • Add optimization.minimizeOptions.json, on by default with futureDefaults. (by @alexander-akait in #22286)

  • Add SSRManifestPlugin and fix server-rendered CSS collection and adoption. (by @alexander-akait in #21913)

  • Add an ignore hook to output.copy and keep unfollowed from symlinks. (by @alexander-akait in #22216)

  • Add optimization.minimize.css.convertApproximateColors. (by @alexander-akait in #22157)

  • Add XML parsing and SVG/XML minification with data URLs and attribute sorting. (by @alexander-akait in #22269)

  • Extract CSS/HTML license comments like JS and safely shorten CSS gradients. (by @alexander-akait in #22408)

  • Resolve an async DefinePlugin.runtimeValue over an async beforeParse hook. (by @alexander-akait in #22210)

  • Add CSS customMedia/customSelectors minimize options; resolve chained names. (by @alexander-akait in #22360)

  • Rename the Harmony* names to ESM* and deprecate the old spellings. (by @hai-x in #22283)

  • Reduce css.syntax/html.syntax to parser, printer, SourceProcessor with one node path. (by @alexander-akait in #22233)

  • Add a JavaScript SyntaxTree read like the CSS one, and toEstreeObject. (by @alexander-akait in #22608)

  • Fix minified code that threw, and add pure_conversions and pure_heritage. (by @alexander-akait in #22473)

  • Shorten more CSS values and selectors, fold longhands, order declarations and gather layer blocks. (by @alexander-akait in #22442)

  • Add optimization.minimize.css.charset; false drops @charset for UTF-8 CSS. (by @alexander-akait in #22632)

Patch Changes

  • Join rules a gathered @layer leaves adjacent, and an at-rule with a later one (by @alexander-akait in #22204)
    stating the same condition; read what a condition declares.

  • Read escaped CSS names and functions as spelled, and minify them unescaped. (by @alexander-akait in #22262)

  • Minify JavaScript, CSS and HTML assets whose names carry a #fragment. (by @alexander-akait in #22277)

  • Require minimizer-webpack-plugin 5.12, so inline scripts in HTML minify again. (by @alexander-akait in #22296)

  • Minify the attributes of an HTML tag without rewriting the template in it. (by @alexander-akait in #22166)

  • Order joined at-rule selector lists and gather a repeated large @layer block. (by @alexander-akait in #22224)

  • Preserve case-sensitive template identifiers when minifying HTML tag attributes. (by @bjohansebas in #22177)

  • Match Acorn's strict directives, Unicode identifiers and expression validation. (by @bjohansebas in #22185)

  • Skip concatenating modules when optimization.providedExports is disabled. (by @hai-x in #22410)

  • Join rules a nesting lowering or duplicate drop left for a second pass. (by @aryanraj45 in #22268)

  • Write U+00A0 in a minified HTML attribute as the character, not &nbsp;. (by @alexander-akait in #22208)

  • Escape a foreign <script> or <style> body, which is character data. (by @alexander-akait in #22233)

  • Name the runtime module whose generation fails while hashing. (by @alexander-akait in #22203)

  • Rebuild a module in watch when its missing unused dependencies swap. (by @alexander-akait in #22693)

  • Rebuild in watch mode when a file is deleted while a build is running. (by @alexander-akait in #22650)

  • Take out the declaration a lowered shorthand writes over, which its source spelling made look like a fallback. (by @aryanraj45 in #22270)

  • Read a foreign <script> or <style> body as character data, not as raw text. (by @alexander-akait in #22258)

  • Keep an inline <style> body as written when rebuilding a page webpack emitted. (by @alexander-akait in #22265)

  • Fix minified HTML for style spellings, CSS quotes, <noscript> and a BOM. (by @alexander-akait in #22370)

  • Record a build dependency required through a spread on Bun. (by @alexander-akait in #22230)

  • Write a nested selector opening on a combinator against its parent the way the printer writes one. (by @aryanraj45 in #22271)

  • Fix missing async stylesheets with a shared runtime. (by [@bjohansebas](https://git...

Read more

v5.111.1

Choose a tag to compare

@github-actions github-actions released this 18 Sep 11:23
5a10675

Patch Changes

v5.111.0

Choose a tag to compare

@github-actions github-actions released this 14 Sep 06:11
9256118

Minor Changes

Patch Changes

Read more

v5.110.3

Choose a tag to compare

@github-actions github-actions released this 01 Sep 19:57
a2d7b9c

Patch Changes

  • Fix import() options, circular reexport severity and namespace writes. (by @alexander-akait in #21867)

  • Skip ESM interop when require() targets a module outside the concatenation. (by @hai-x in #21884)

  • Fix concatenated require() in a require.ensure callback or a computed request. (by @hai-x in #21907)

  • Keep optimization.minimize a boolean; its options move to minimizeOptions. (by @alexander-akait in #21886)

  • Fix mangled exports read through require() and a leaked internal reference. (by @alexander-akait in #21905)

  • Fix new on a default import of a wrapped CommonJS module. (by @alexander-akait in #21876)

  • Throw when a deferred namespace of an async module is forced while it evaluates. (by @alexander-akait in #21871)

  • Do not report a missing export for a name a side-effect-free barrel defers. (by @alexander-akait in #21874)

  • Fix queue, URL scheme, dotenv, HTTP module and persistent cache edge cases. (by @alexander-akait in #21901)

  • Evaluate a deferred import's async dependencies where the import sits. (by @alexander-akait in #21902)

  • Omit ambiguous export * names from the module namespace. (by @alexander-akait in #21878)

v5.110.2

Choose a tag to compare

@github-actions github-actions released this 30 Aug 14:53
75eec50

Patch Changes

v5.110.1

Choose a tag to compare

@github-actions github-actions released this 27 Aug 20:01
0b2952e

Patch Changes

  • Fix a capture-group-less snapshot.managedPaths RegExp; speed up cache writes. (by @alexander-akait in #21843)

  • Throw SyntaxError, or WebAssembly.CompileError, from an unparsable module. (by @alexander-akait in #21847)

  • Accept the optimization.minimize: true shorthand set by a plugin in apply(). (by @AgentEnder in #21845)

v5.110.0

Choose a tag to compare

@github-actions github-actions released this 27 Aug 11:28
3a7c0e6

Minor Changes

  • Wrap concatenated modules in lazy __webpack_require__.cw accessors and inline require(), keeping a wrapped body's names and side effects intact. (by @hai-x in #21519)

  • 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. (by @alexander-akait in #21841)

  • Add the descriptionRelativePath module rule condition. (by @alexander-akait in #21705)

  • Add OS-independent glob matching to module rules. (by @alexander-akait in #21771)

  • Report inner-graph, AMD and bare module bailouts in optimizationBailout. (by @alexander-akait in #21740)

  • Allow marking externals as side-effect-free with a sideEffects flag. (by @alexander-akait in #21712)

  • Give externals the original request of a context module element. (by @alexander-akait in #21780)

  • Add the externalsPresets.nodeModules preset with an allowlist option to externalize installed packages, replacing the webpack-node-externals plugin. (by @alexander-akait in #21569)

  • Add output.library.umdAmdContainer for an AMD-style loader branch in UMD. (by @hai-x in #21770)

  • Resolve @custom-media values that are true / false or name another custom media. (by @alexander-akait in #21624)

  • 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. (by @alexander-akait in #21576)

  • Patch the HTML <head> in place on hot update instead of forcing a full reload, including when a <script> that never executed is removed. (by @alexander-akait in #21624)

  • Scope counter names in CSS modules; fix the counter() counter-style and animation timeline keywords. (by @alexander-akait in #21600)

  • Derive import defer / import source from the target and fix the source phase. (by @alexander-akait in #21810)

  • Emit analyzable ESM urls for chunks, assets, styles, workers and wasm. (by @alexander-akait in #21788)

  • 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. (by @alexander-akait in #21841)

  • Resolve relative entry baseUri values and bake one side of a hash cycle. (by @alexander-akait in #21750)

  • 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. (by @alexander-akait in #21841)

  • 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. (by @alexander-akait in #21841)

  • 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. (by @alexander-akait in #21841)

  • Suggest the closest name or a casing fix anywhere in a failed request. (by @alexander-akait in #21727)

  • Add aggregated shutdown hook to MultiCompiler. (by @bjohansebas in #21578)

  • Report which compilers changed on the MultiCompiler done hook. (by @bjohansebas in #21580)

  • Add [containedpath]/[containedfile] placeholders, used for [path]/[file] of asset and html modules with experiments.futureDefaults. (by @alexander-akait in #21592)

  • Support an object for an entry's html that overrides output.html per option. (by @alexander-akait in #21574)

  • Configure or exclude each asset type's minifier via optimization.minimize. (by @alexander-akait in #21663)

  • Support printing CSS and HTML beautified as well as minified. (by @alexander-akait in #21660)

  • Add renderEmbeddedSource, and minify what it offers out of the box. (by @alexander-akait in #21830)

  • Report bindings named eval, arguments or reserved words in ES module output. (by @alexander-akait in #21567)

  • Emit no development source map for module libraries, or any with futureDefaults. (by @alexander-akait in #21839)

  • 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. (by @alexander-akait in #21841)

  • Improve tree-shaking for a namespace reexported as default, and fix import d from "./mod"; d.member reading undefined in that case. (by @alexander-akait in #21841)

  • Warn on cross-kind CSS module export conflicts and let the class win. (by @alexander-akait in #21538)

  • Add output.resourceHints.dedupe to skip prefetch links for already preloaded/prefetched chunks. (by @alexander-akait in #21386)

Patch Changes

  • Let a memory-cache etag misma...
Read more

v5.109.2

Choose a tag to compare

@github-actions github-actions released this 28 Jul 18:14
6a24bd6

Patch Changes

  • Resolve aliases pointing at a package directory whose name ends with .js again. (by @alexander-akait in #21542)

  • Name CSS sources in source maps by their resource path, without the css prefix. (by @bjohansebas in #21536)

  • Delete no longer referenced files from the filesystem cache directory after storing the cache, age them by recorded time so restored caches are cleaned too, and collect every fully expired pack in one store instead of one per build. (by @bjohansebas in #21528)

  • Report "universal" as the loader context target for the universal target. (by @alexander-akait in #21540)

  • Skip require().prop in dead branches gated by inlined imported constants. (by @hai-x in #21517)

  • Annotate configuration options and public hooks in the generated types with the @since JSDoc tag. (by @bjohansebas in #21473)