GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(html): offer dropping an attribute that restates the default by alexander-akait · Pull Request #21685 · webpack/webpack

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Aug 11, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Other minifiers drop <script type=text/javascript> and <input type=text>; webpack kept both, because an attribute selector matches the content attribute rather than the reflected default, so input[type=text] stops matching. Adds optimization.minimize.html.removeRedundantAttributes, "none" by default.

Measured what the others actually do at their own defaults: minify-html drops all of them, @swc/html drops script[type] but keeps input[type], and html-minifier-terser and htmlnano's safe preset drop none. "smart" matches @swc/html — only the type/language markers no stylesheet selects on. "all" also drops the spec defaults, which is the unsafe part.

What kind of change does this PR introduce?

feat — one opt-in option, "none" by default, so nothing changes unless it is set.

Did you add tests for your changes?

Yes — test/configCases/html/minimize-redundant-attributes snapshots "smart": style[type] and link[type] go, input[type] / form[method] / button[type] stay, and type=module / application/ld+json are untouched. The 128 existing html snapshots pass unchanged, which is the evidence that "none" is byte-identical.

Does this PR introduce a breaking change?

No — "none" is the default.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

One new optimization.minimize.html property; its schema description spells out all three modes and why "all" is unsafe.

Use of AI

AI (Claude Code) was used to measure the other minifiers' defaults, derive the two tables into tooling/generate-html-data.js, implement the option and write the test. All output was reviewed and the lint, type, generator and test checks were run locally.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added HTML minimization options to remove empty elements and attributes.
    • Added smart or comprehensive removal of redundant default attributes.
    • Added sorting for HTML attributes and class names, including duplicate class removal.
    • Added merging of compatible adjacent <style> elements while preserving ordering and safety exceptions.
  • Documentation
    • Documented the new HTML minimization options and configuration support.
  • Tests
    • Added coverage for empty elements and attributes, redundant attributes, sorting, and style merging.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@changeset-bot

changeset-bot Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0ef9dbe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added area: config Options, defaults, validation (lib/config, schemas/) area: html Experimental HTML support (lib/html) area: types types.d.ts, JSDoc annotations, hand-maintained declarations area: tooling Repo tooling, codegen, CLI entry (tooling/, bin/) labels Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "tools"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

The HTML minimizer adds configurable removal of empty and redundant attributes, removal of empty elements, attribute and class sorting, duplicate class-token removal, structural tag omission, and compatible adjacent <style> folding. The changes include option plumbing, generated lookup data, schema updates, and unit and configuration tests.

Changes

HTML minimization enhancements

Layer / File(s) Summary
Option contracts and pipeline wiring
schemas/WebpackOptions.json, lib/html/htmlMinify.js, lib/util/SourceProcessor.js, .changeset/...
The new minimizer options are documented, schema-validated, typed, and forwarded to the print context.
Attribute metadata and normalization
tooling/generate-html-data.js, lib/html/syntax.js
Generated lookup tables support empty and redundant attribute detection. The printer removes configured attributes and empty elements, deduplicates class tokens, and optionally sorts attributes and class names.
Structural tag omission and adjacent style merging
lib/html/syntax.js, tooling/generate-html-data.js
The printer omits eligible structural tags and merges compatible adjacent CSS <style> elements. Rejected CSS, ordering-sensitive at-rules, comments, and blocking elements preserve required boundaries.
Minimization behavior validation
test/HtmlSyntax.unittest.js, test/configCases/html/minimize-*
Unit and emitted-HTML tests cover option behavior, preserved exceptions, CSS merge safeguards, structural tag omission, sorting, and redundant-attribute modes.

Possibly related PRs

  • webpack/webpack#21663: Extends related HTML minimizer options through the same pipeline.
  • webpack/webpack#21676: Modifies shared HTML syntax and generated HTML data tables.
  • webpack/webpack#21682: Adds another HTML minimizer option through the same configuration and processing path.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required Conventional Commit form and accurately describes the redundant HTML attribute removal feature.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch feat/html-remove-redundant-attributes

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (9db1341).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@9db1341
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@9db1341
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@9db1341
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.73984% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.49%. Comparing base (075b1ce) to head (0ef9dbe).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/html/syntax.js 82.22% 40 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21685      +/-   ##
==========================================
- Coverage   94.51%   94.49%   -0.03%     
==========================================
  Files         631      631              
  Lines       82402    82727     +325     
  Branches    24422    24580     +158     
==========================================
+ Hits        77885    78172     +287     
- Misses       4517     4555      +38     
Flag Coverage Δ
css-parsing 26.57% <100.00%> (-0.03%) ⬇️
html5lib 30.94% <28.04%> (-0.04%) ⬇️
integration 88.13% <55.69%> (-0.09%) ⬇️
test262 51.65% <ø> (-0.06%) ⬇️
unit 54.64% <83.73%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 11, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
tooling/generate-html-data.js (1)

1185-1214: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Do not hand-maintain the redundant-attribute metadata.

Derive these mappings from a published dataset. If a source cannot provide them, add a SUPPLEMENT entry that states why.

As per path instructions: “Generators must derive tables from published datasets … rather than hand-typing name lists; a SUPPLEMENT entry needs a stated reason it cannot be derived.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tooling/generate-html-data.js` around lines 1185 - 1214, Replace the
hand-maintained REDUNDANT_TYPE_ATTRIBUTES and REDUNDANT_DEFAULT_ATTRIBUTES
mappings with data derived from the applicable published dataset. For any
attributes the dataset cannot provide, add a SUPPLEMENT entry documenting the
specific reason they require manual coverage, while preserving the existing
metadata structure and values.

Source: Path instructions

lib/html/htmlMinify.js (1)

63-65: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten this source comment.

Keep the comment to two short lines or fewer.

As per coding guidelines: “Keep comments as short as possible, generally one line and no more than two short lines.” As per path instructions: “Comments must be at most two short lines and add non-obvious information.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/html/htmlMinify.js` around lines 63 - 65, Shorten the comment near
process and minimize to no more than two brief lines, retaining only the
non-obvious points that processing parses once and that the returned map is
unused because HTML serialization produces no mappings.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/html/syntax.js`:
- Around line 9063-9067: Update the attribute-processing flow around
_isRedundantAttribute to extract rawValue before branching on quoted values,
then check and remove redundant values for both quoted and unquoted attributes
when the selected mode permits it. Preserve the existing consumedEnd handling
and continue behavior before entering value rewriting.

In `@test/configCases/html/minimize-redundant-attributes/page.html`:
- Line 15: Wrap the standalone td element in
test/configCases/html/minimize-redundant-attributes/page.html with table, tbody,
and tr elements so it is parsed as a table cell and the snapshot can verify
retention of colspan="1".

In `@test/configCases/html/minimize-redundant-attributes/webpack.config.js`:
- Around line 12-14: Add a separate integration configuration case alongside the
existing minimize-redundant-attributes case, using removeRedundantAttributes set
to "all" instead of "smart". Include assertions verifying that default-valued
HTML attributes are removed, covering the new "all" mode branch while preserving
the existing smart-mode case.

---

Nitpick comments:
In `@lib/html/htmlMinify.js`:
- Around line 63-65: Shorten the comment near process and minimize to no more
than two brief lines, retaining only the non-obvious points that processing
parses once and that the returned map is unused because HTML serialization
produces no mappings.

In `@tooling/generate-html-data.js`:
- Around line 1185-1214: Replace the hand-maintained REDUNDANT_TYPE_ATTRIBUTES
and REDUNDANT_DEFAULT_ATTRIBUTES mappings with data derived from the applicable
published dataset. For any attributes the dataset cannot provide, add a
SUPPLEMENT entry documenting the specific reason they require manual coverage,
while preserving the existing metadata structure and values.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 78219f1b-b293-451e-80d4-e4c5450c223a

📥 Commits

Reviewing files that changed from the base of the PR and between 638ce71 and 306d65f.

⛔ Files ignored due to path filters (7)
  • declarations/WebpackOptions.d.ts is excluded by !declarations/**
  • lib/html/data.js is excluded by !lib/html/data.js
  • schemas/WebpackOptions.check.js is excluded by !schemas/**/*.check.js
  • test/__snapshots__/Cli.basictest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • types.d.ts is excluded by !types.d.ts
📒 Files selected for processing (10)
  • .changeset/048-html-remove-redundant-attributes.md
  • lib/html/htmlMinify.js
  • lib/html/syntax.js
  • lib/util/SourceProcessor.js
  • schemas/WebpackOptions.json
  • test/configCases/html/minimize-redundant-attributes/index.js
  • test/configCases/html/minimize-redundant-attributes/page.html
  • test/configCases/html/minimize-redundant-attributes/test.config.js
  • test/configCases/html/minimize-redundant-attributes/webpack.config.js
  • tooling/generate-html-data.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/html/syntax.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/configCases/html/minimize-redundant-attributes/page.html Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/configCases/html/minimize-redundant-attributes/webpack.config.js
Comment on lines +12 to +14
optimization: {
minimize: { html: { removeRedundantAttributes: "smart" } },
minimizer: ["..."]

@coderabbitai coderabbitai Bot Aug 11, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add an integration case for "all" mode.

This case exercises only "smart". Add a separate configuration case that uses "all" and asserts removal of default-valued attributes.

As per coding guidelines: “Cover every changed line and branch with tests, preferably through integration cases.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/configCases/html/minimize-redundant-attributes/webpack.config.js` around
lines 12 - 14, Add a separate integration configuration case alongside the
existing minimize-redundant-attributes case, using removeRedundantAttributes set
to "all" instead of "smart". Include assertions verifying that default-valued
HTML attributes are removed, covering the new "all" mode branch while preserving
the existing smart-mode case.

Source: Coding guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Generated code size

Comparing 0ef9dbe merged into 075b1ce against 075b1ce. Merging this PR will change the code webpack generates.

Changed New Deleted Unchanged Raw change
Cases 20 20 0 1551 🔴 ↑ +325.42 KiB
Assets 38 126 3 6116 🔴 ↑ +325.42 KiB
Runtimes 15 39 0 1918 —
167 asset(s) changed size, biggest 20 by raw change
Asset Before After Change Gzip (9) Brotli (11) Zstd (19)
➕ analyzable/shared-module-chunk bundle0.mjs — 21.37 KiB +21.37 KiB (new) new new new
➕ wasm/analyzable-templated-url-public-path 3/bundle3.mjs — 12.26 KiB +12.26 KiB (new) new new new
➕ wasm/analyzable-templated-url-public-path 4/bundle4.mjs — 12.23 KiB +12.23 KiB (new) new new new
➕ wasm/analyzable-templated-url-public-path 5/bundle5.mjs — 12.15 KiB +12.15 KiB (new) new new new
➕ wasm/sync-constant-public-path bundle0.mjs — 11.47 KiB +11.47 KiB (new) new new new
➕ wasm/analyzable-runtime-scope main.mjs — 9.80 KiB +9.80 KiB (new) new new new
➕ analyzable/shared-depths-import-fallback bundle0.mjs — 9.75 KiB +9.75 KiB (new) new new new
➕ analyzable/asset-url-wrapperless bundle0.mjs — 9.39 KiB +9.39 KiB (new) new new new
➖ analyzable/shared-depths-import-fallback main.[hash].mjs 9.33 KiB — -9.33 KiB (gone) gone gone gone
➕ analyzable/stand-in-lookalike bundle0.mjs — 9.04 KiB +9.04 KiB (new) new new new
➕ analyzable/asset-url-relative-public-path 2/bundle2.mjs — 8.14 KiB +8.14 KiB (new) new new new
➕ analyzable/asset-url-relative-public-path 1/bundle1.mjs — 8.04 KiB +8.04 KiB (new) new new new
➕ analyzable/asset-url-relative-public-path 0/bundle0.mjs — 8.04 KiB +8.04 KiB (new) new new new
➕ analyzable/asset-url-shared-depths bundle0.mjs — 8.03 KiB +8.03 KiB (new) new new new
➕ analyzable/asset-url-matrix 7/bundle7.mjs — 7.74 KiB +7.74 KiB (new) new new new
➕ analyzable/asset-url-matrix 6/bundle6.mjs — 7.72 KiB +7.72 KiB (new) new new new
➕ analyzable/asset-url-matrix 5/bundle5.mjs — 7.70 KiB +7.70 KiB (new) new new new
➕ analyzable/asset-url-matrix 3/bundle3.mjs — 7.69 KiB +7.69 KiB (new) new new new
➕ analyzable/asset-url-matrix 4/bundle4.mjs — 7.69 KiB +7.69 KiB (new) new new new
➕ analyzable/asset-url-matrix 1/bundle1.mjs — 7.67 KiB +7.67 KiB (new) new new new
… 147 more asset(s), see the uploaded report
54 runtime(s) changed which runtime modules they carry, biggest 20 by number moved
Runtime Modules Added Removed
➕ analyzable/shared-module-chunk main 0 → 8 consumes, define property getters, ensure chunk, get javascript chunk filename, hasOwnProperty shorthand, import chunk loading, make namespace object, sharing —
➕ wasm/analyzable-templated-url-public-path 4/main 0 → 8 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath, wasm loading —
➕ wasm/analyzable-runtime-scope main 0 → 7 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/analyzable-templated-url-public-path 3/main 0 → 7 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ wasm/analyzable-templated-url-public-path 5/main 0 → 7 async module, define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm loading —
➕ analyzable/asset-url-wrapperless main 0 → 6 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ wasm/sync-constant-public-path main 0 → 6 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object, wasm chunk loading —
➕ analyzable/asset-url-base-uri 1/main 0 → 5 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/asset-url-base-uri 1/other 0 → 5 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/asset-url-base-uri 2/main 0 → 5 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/asset-url-base-uri 2/other 0 → 5 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/asset-url-function-public-path 3/main 0 → 5 define property getters, hasOwnProperty shorthand, import chunk loading, make namespace object, publicPath —
➕ analyzable/asset-url-matrix 0/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/asset-url-matrix 1/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/asset-url-matrix 2/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/asset-url-matrix 3/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/asset-url-matrix 4/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/asset-url-matrix 5/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/asset-url-matrix 6/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
➕ analyzable/asset-url-matrix 7/main 0 → 5 define property getters, ensure chunk, hasOwnProperty shorthand, import chunk loading, make namespace object —
… 34 more runtime(s), see the uploaded report

Built test/configCases with the defaults a user gets: 1591 case(s), 6280 asset(s), 40 emitted nothing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codspeed

codspeed Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Merging this PR will improve performance by 42.52%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 309 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory benchmark "future-defaults", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 336.3 KB 236 KB +42.52%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/html-remove-redundant-attributes (0ef9dbe) with main (7299185)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 11, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tooling/generate-html-data.js`:
- Around line 1190-1196: The smart-mode attribute list around the selector
mappings must not include style type, link type/media, or script
language/charset entries because these attributes are observable by selectors
and scripts. Move these entries from the smart configuration to the all
configuration, preserving smart mode only for attributes safe to omit and
keeping the existing lib/html/syntax.js mapping behavior consistent.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ea7da349-8d4f-472e-92d2-ebfc2cd76679

📥 Commits

Reviewing files that changed from the base of the PR and between 306d65f and 792c84f.

⛔ Files ignored due to path filters (11)
  • declarations/WebpackOptions.d.ts is excluded by !declarations/**
  • lib/html/data.js is excluded by !lib/html/data.js
  • schemas/WebpackOptions.check.js is excluded by !schemas/**/*.check.js
  • test/__snapshots__/Cli.basictest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes-all/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes-all/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-transforms/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-transforms/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • types.d.ts is excluded by !types.d.ts
📒 Files selected for processing (14)
  • .changeset/048-html-remove-redundant-attributes.md
  • lib/html/htmlMinify.js
  • lib/html/syntax.js
  • lib/util/SourceProcessor.js
  • schemas/WebpackOptions.json
  • test/configCases/html/minimize-redundant-attributes-all/index.js
  • test/configCases/html/minimize-redundant-attributes-all/page.html
  • test/configCases/html/minimize-redundant-attributes-all/test.config.js
  • test/configCases/html/minimize-redundant-attributes-all/webpack.config.js
  • test/configCases/html/minimize-redundant-attributes/index.js
  • test/configCases/html/minimize-redundant-attributes/page.html
  • test/configCases/html/minimize-redundant-attributes/test.config.js
  • test/configCases/html/minimize-redundant-attributes/webpack.config.js
  • tooling/generate-html-data.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (9)
  • schemas/WebpackOptions.json
  • test/configCases/html/minimize-redundant-attributes/webpack.config.js
  • .changeset/048-html-remove-redundant-attributes.md
  • lib/html/htmlMinify.js
  • test/configCases/html/minimize-redundant-attributes/test.config.js
  • lib/util/SourceProcessor.js
  • test/configCases/html/minimize-redundant-attributes/index.js
  • test/configCases/html/minimize-redundant-attributes/page.html
  • lib/html/syntax.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tooling/generate-html-data.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 11, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
lib/html/syntax.js (1)

8611-8625: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the new explanatory comments.

Keep each comment to one or two short lines. Retain only information that the code or test name does not show.

  • lib/html/syntax.js#L8611-L8625: reduce the absorbed-style and CSS-minification prose.
  • lib/html/syntax.js#L9019-L9028: reduce the merge-algorithm rationale.
  • test/HtmlSyntax.unittest.js#L3717-L3721: reduce the unit-test scope explanation.
  • test/configCases/html/minimize-empty-attributes/test.config.js#L20-L25: reduce the character-reference and title/lang explanations.

As per coding guidelines: “Keep comments as short as possible, generally one line and no more than two short lines.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/html/syntax.js` around lines 8611 - 8625, Shorten the explanatory
comments at lib/html/syntax.js lines 8611-8625, 9019-9028,
test/HtmlSyntax.unittest.js lines 3717-3721, and
test/configCases/html/minimize-empty-attributes/test.config.js lines 20-25. Keep
each comment to one or two short lines, retaining only details not evident from
the surrounding code or test names; do not change behavior.

Source: Coding guidelines

tooling/generate-html-data.js (1)

1185-1193: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the new tooling comments.

This explanatory block spans more than two short lines. Keep only the non-obvious exclusion rule here. Move the detailed title, lang, and URL semantics to the option documentation.

Proposed simplification
-	// Global attributes whose empty value is the state the spec gives their
-	// absence, so `removeEmptyAttributes` may drop them. Deliberately short:
-	// `title=""` and `lang=""` look like members and are not, because the spec
-	// gives each of them a meaning absence does not have — an empty `title` says
-	// the element has no advisory information, overriding an ancestor's, and an
-	// empty `lang` says the language is unknown rather than inherited. Every
-	// other minifier drops both. `href` / `src` / `action` are out for the same
-	// reason: an empty URL resolves to the document's own address, which is not
-	// what no URL at all does.
+	// Empty class, dir, id, and style values may be removed when enabled.
+	// Keep title, lang, href, src, and action because empty differs from absent.

As per coding guidelines, comments should be “generally one line and no more than two short lines.”
As per path instructions, tooling/** comments “must be at most two short lines.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tooling/generate-html-data.js` around lines 1185 - 1193, Shorten the comment
above the global empty-value attribute list to at most two short lines,
retaining only the non-obvious exclusion rule for attributes such as title,
lang, href, src, and action. Move the detailed attribute semantics into the
relevant option documentation.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/html/syntax.js`:
- Around line 10123-10125: Restore the opt-in default by setting
_removeRedundantAttributes in lib/html/syntax.js:10123-10125 to "none". Update
schemas/WebpackOptions.json:3720-3723 to accept and document "none" as the
default, add "none" to PrintOptions["removeRedundantAttributes"] in
lib/util/SourceProcessor.js:43, and update the forwarded process-option type and
default-output handling in lib/util/SourceProcessor.js:694-712 to support
"none".

---

Nitpick comments:
In `@lib/html/syntax.js`:
- Around line 8611-8625: Shorten the explanatory comments at lib/html/syntax.js
lines 8611-8625, 9019-9028, test/HtmlSyntax.unittest.js lines 3717-3721, and
test/configCases/html/minimize-empty-attributes/test.config.js lines 20-25. Keep
each comment to one or two short lines, retaining only details not evident from
the surrounding code or test names; do not change behavior.

In `@tooling/generate-html-data.js`:
- Around line 1185-1193: Shorten the comment above the global empty-value
attribute list to at most two short lines, retaining only the non-obvious
exclusion rule for attributes such as title, lang, href, src, and action. Move
the detailed attribute semantics into the relevant option documentation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fbc30abd-f981-4353-b766-6392555e5783

📥 Commits

Reviewing files that changed from the base of the PR and between 792c84f and 3c67d23.

⛔ Files ignored due to path filters (9)
  • declarations/WebpackOptions.d.ts is excluded by !declarations/**
  • lib/html/data.js is excluded by !lib/html/data.js
  • schemas/WebpackOptions.check.js is excluded by !schemas/**/*.check.js
  • test/__snapshots__/Cli.basictest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-attributes/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-attributes/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-merge-styles/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-merge-styles/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • types.d.ts is excluded by !types.d.ts
📒 Files selected for processing (15)
  • .changeset/048-html-remove-redundant-attributes.md
  • lib/html/htmlMinify.js
  • lib/html/syntax.js
  • lib/util/SourceProcessor.js
  • schemas/WebpackOptions.json
  • test/HtmlSyntax.unittest.js
  • test/configCases/html/minimize-empty-attributes/index.js
  • test/configCases/html/minimize-empty-attributes/page.html
  • test/configCases/html/minimize-empty-attributes/test.config.js
  • test/configCases/html/minimize-empty-attributes/webpack.config.js
  • test/configCases/html/minimize-merge-styles/index.js
  • test/configCases/html/minimize-merge-styles/page.html
  • test/configCases/html/minimize-merge-styles/test.config.js
  • test/configCases/html/minimize-merge-styles/webpack.config.js
  • tooling/generate-html-data.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/048-html-remove-redundant-attributes.md
  • lib/html/htmlMinify.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/html/syntax.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 11, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
lib/html/syntax.js (1)

8615-8622: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Shorten the added comments.

These comments exceed two short lines. Several restate nearby code. Keep only non-obvious constraints.

  • lib/html/syntax.js#L8615-L8622: reduce the state-option comments to short declarations.
  • lib/html/syntax.js#L8778-L8788: reduce the empty-element rationale to a short safety note.
  • lib/html/syntax.js#L8816-L8819: reduce the token-list behavior description.
  • lib/html/syntax.js#L8886-L8888: reduce the class-only sorting explanation.
  • lib/html/syntax.js#L9192-L9195: reduce the attribute-ordering explanation.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/html/syntax.js` around lines 8615 - 8622, Shorten the comments in
lib/html/syntax.js at lines 8615-8622, 8778-8788, 8816-8819, 8886-8888, and
9192-9195: reduce the state-option notes to brief declarations, retain only a
short safety note for empty elements, and condense the token-list, class-only
sorting, and attribute-ordering explanations to their non-obvious constraints.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/html/syntax.js`:
- Around line 8824-8834: Update _normalizeTokenList so the default sort=false
path preserves duplicate tokens and returns the collapsed token string
unchanged. Only deduplicate tokens when an explicit removal option is enabled;
do not let the existing sort flag remove duplicates, preserving class attribute
values such as "a a".

In `@schemas/WebpackOptions.json`:
- Around line 3720-3738: Regenerate the public TypeScript declarations for the
new removeEmptyElements, removeRedundantAttributes, sortAttributes, and
sortClassNames schema options by running yarn fix:special, then include the
generated types.d.ts outputs in the change.

---

Nitpick comments:
In `@lib/html/syntax.js`:
- Around line 8615-8622: Shorten the comments in lib/html/syntax.js at lines
8615-8622, 8778-8788, 8816-8819, 8886-8888, and 9192-9195: reduce the
state-option notes to brief declarations, retain only a short safety note for
empty elements, and condense the token-list, class-only sorting, and
attribute-ordering explanations to their non-obvious constraints.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 782a9f2d-8bff-4bfe-8902-e221caf7e638

📥 Commits

Reviewing files that changed from the base of the PR and between 3c67d23 and 50a032a.

⛔ Files ignored due to path filters (10)
  • declarations/WebpackOptions.d.ts is excluded by !declarations/**
  • lib/html/data.js is excluded by !lib/html/data.js
  • schemas/WebpackOptions.check.js is excluded by !schemas/**/*.check.js
  • test/__snapshots__/Cli.basictest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-elements/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-elements/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-sort/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-sort/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-transforms/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-transforms/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
📒 Files selected for processing (15)
  • .changeset/048-html-remove-redundant-attributes.md
  • lib/html/htmlMinify.js
  • lib/html/syntax.js
  • lib/util/SourceProcessor.js
  • schemas/WebpackOptions.json
  • test/HtmlSyntax.unittest.js
  • test/configCases/html/minimize-empty-elements/index.js
  • test/configCases/html/minimize-empty-elements/page.html
  • test/configCases/html/minimize-empty-elements/test.config.js
  • test/configCases/html/minimize-empty-elements/webpack.config.js
  • test/configCases/html/minimize-sort/index.js
  • test/configCases/html/minimize-sort/page.html
  • test/configCases/html/minimize-sort/test.config.js
  • test/configCases/html/minimize-sort/webpack.config.js
  • tooling/generate-html-data.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (3)
  • .changeset/048-html-remove-redundant-attributes.md
  • lib/html/htmlMinify.js
  • tooling/generate-html-data.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/html/syntax.js Outdated
Comment on lines +8824 to +8834
const _normalizeTokenList = (raw, sort) => {
const collapsed = _asciiTrim(raw).replace(/[\t\n\f\r ]+/g, " ");
if (!collapsed.includes(" ")) return collapsed;
const tokens = collapsed.split(" ");
let duplicated = false;
for (let i = 1; i < tokens.length && !duplicated; i++) {
duplicated = tokens.indexOf(tokens[i]) !== i;
}
if (!duplicated && !sort) return collapsed;
const unique = duplicated ? [...new Set(tokens)] : tokens;
return (sort ? unique.sort() : unique).join(" ");

@coderabbitai coderabbitai Bot Aug 11, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve duplicate class tokens unless removal is explicitly enabled.

When sort is false, <div class="a a"> becomes <div class="a">. This changes selectors such as [class="a a"] and getAttribute("class") during default minimization. Keep duplicate tokens, or add a separate opt-in option for removing them.

Proposed fix
 	const tokens = collapsed.split(" ");
-	let duplicated = false;
-	for (let i = 1; i < tokens.length && !duplicated; i++) {
-		duplicated = tokens.indexOf(tokens[i]) !== i;
-	}
-	if (!duplicated && !sort) return collapsed;
-	const unique = duplicated ? [...new Set(tokens)] : tokens;
-	return (sort ? unique.sort() : unique).join(" ");
+	if (!sort) return collapsed;
+	return tokens.sort().join(" ");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const _normalizeTokenList = (raw, sort) => {
const collapsed = _asciiTrim(raw).replace(/[\t\n\f\r ]+/g, " ");
if (!collapsed.includes(" ")) return collapsed;
const tokens = collapsed.split(" ");
let duplicated = false;
for (let i = 1; i < tokens.length && !duplicated; i++) {
duplicated = tokens.indexOf(tokens[i]) !== i;
}
if (!duplicated && !sort) return collapsed;
const unique = duplicated ? [...new Set(tokens)] : tokens;
return (sort ? unique.sort() : unique).join(" ");
const _normalizeTokenList = (raw, sort) => {
const collapsed = _asciiTrim(raw).replace(/[\t\n\f\r ]+/g, " ");
if (!collapsed.includes(" ")) return collapsed;
const tokens = collapsed.split(" ");
if (!sort) return collapsed;
return tokens.sort().join(" ");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/html/syntax.js` around lines 8824 - 8834, Update _normalizeTokenList so
the default sort=false path preserves duplicate tokens and returns the collapsed
token string unchanged. Only deduplicate tokens when an explicit removal option
is enabled; do not let the existing sort flag remove duplicates, preserving
class attribute values such as "a a".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread schemas/WebpackOptions.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 11, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tooling/generate-html-data.js (1)

286-289: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Shorten the new explanatory comments.

Reduce each new comment to one or two short lines. Keep the required spec reference and the non-obvious parser constraint.

  • tooling/generate-html-data.js#L286-L289: shorten the wrapper end-tag comment.
  • tooling/generate-html-data.js#L1319-L1325: shorten the body start-tag blocker comment.
  • tooling/generate-html-data.js#L1513-L1528: shorten the generated comments emitted into the lib/ source file.

As per coding guidelines, “Keep comments as short as possible, generally one line and no more than two short lines.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tooling/generate-html-data.js` around lines 286 - 289, Shorten the
explanatory comments in tooling/generate-html-data.js at lines 286-289,
1319-1325, and 1513-1528 to one or two brief lines each. Preserve the required
specification reference and the non-obvious parser constraints, including the
wrapper end-tag, body start-tag, and generated lib/ comments; no code behavior
changes are needed.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tooling/generate-html-data.js`:
- Around line 286-289: Shorten the explanatory comments in
tooling/generate-html-data.js at lines 286-289, 1319-1325, and 1513-1528 to one
or two brief lines each. Preserve the required specification reference and the
non-obvious parser constraints, including the wrapper end-tag, body start-tag,
and generated lib/ comments; no code behavior changes are needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b05144c-2c63-4d4b-be05-ba3a5cd98160

📥 Commits

Reviewing files that changed from the base of the PR and between 50a032a and 53cb33a.

⛔ Files ignored due to path filters (34)
  • declarations/WebpackOptions.d.ts is excluded by !declarations/**
  • lib/html/data.js is excluded by !lib/html/data.js
  • test/__snapshots__/Cli.basictest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-attributes/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-attributes/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-collapse-whitespace/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-collapse-whitespace/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-css-options/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-css-options/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-attributes/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-attributes/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-elements/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-empty-elements/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-end-tag-in-formatting/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-end-tag-in-formatting/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-environment/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-environment/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-merge-styles/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-merge-styles/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes-all/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes-all/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-redundant-attributes/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-sort/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-sort/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-transforms/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/minimize-transforms/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/parser-foreign-content/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/parser-foreign-content/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/parser-foster-parenting/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/parser-foster-parenting/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/parser-template-insertion-mode/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/parser-template-insertion-mode/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • types.d.ts is excluded by !types.d.ts
📒 Files selected for processing (6)
  • lib/html/syntax.js
  • schemas/WebpackOptions.json
  • test/HtmlSyntax.unittest.js
  • test/configCases/html/minimize-redundant-attributes/page.html
  • test/configCases/html/minimize-redundant-attributes/test.config.js
  • tooling/generate-html-data.js
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • webpack/schema-utils (auto-detected)
  • webpack/tapable (auto-detected)
🚧 Files skipped from review as they are similar to previous changes (3)
  • test/configCases/html/minimize-redundant-attributes/page.html
  • schemas/WebpackOptions.json
  • lib/html/syntax.js

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
alexander-akait added 13 commits August 12, 2026 08:45
@alexander-akait
feat(html): offer dropping an attribute that restates the default
ddabffb
Other minifiers drop `<script type=text/javascript>` and `<input type=text>`;
webpack kept both, because an attribute selector matches the content attribute
rather than the reflected default, so `input[type=text]` stops matching.

Add `optimization.minimize.html.removeRedundantAttributes`, `"none"` by
default. `"smart"` drops only the type/language markers no stylesheet selects
on, which is what @swc/html does by default; `"all"` also drops the spec
defaults, which is the unsafe part. The two tables are generated, and the
JavaScript spellings reuse `JAVASCRIPT_SCRIPT_TYPES` rather than a second list.

The flags are read where the walk starts, not in `printer`: a tag streams out
before the first `printer` call, so setting them there left a top-level tag
unaffected.
@alexander-akait
feat(html): align smart with @swc/html's attribute set
ea2d6a6
Measured what @swc/html drops at its default: also `<link media=all>` on any
`rel`, and `<script charset=utf-8>`, which is obsolete and ignored when it
matches the document encoding. `<style media=all>` is kept, as it is there.

Matched ASCII-case-insensitively throughout. @swc/html lowercases `type` but
not `media` or `charset`, so it keeps `media=ALL` and `charset=UTF-8` while
dropping the lowercase spellings — an inconsistency not worth copying.
@alexander-akait
feat(html): drop the redundant type markers by default
3fcd198
`removeRedundantAttributes` now defaults to "smart" and no longer takes
"none": that tier only drops the type/language/charset markers nothing a
selector or script reads can observe, which is what @swc/html does by
default. "all" stays opt-in — it drops spec defaults like
`input[type=text]`, which an attribute selector does match.
@alexander-akait
perf(html): gate the redundancy check on one lookup
63e7983
Now that it runs by default it sees every printed attribute, and almost
none is on an element either table names. Group the tables by element in
the generator so one lookup gates, instead of trimming, lowercasing and
building an `element attribute` key first. On a 2000-attribute body that
is 2000 fewer key strings and 4000 fewer scans; zero on the miss path.
@alexander-akait
feat(html): fold adjacent <style>, and offer dropping an empty attribute
27ae242
Two adjacent `<style>` with the same attributes print as one. Adjacency is
what makes it safe: only whitespace may lie between, nothing is hoisted, so
the cascade is the one the source wrote. Each sheet is minified before it is
joined rather than after — text the minifier could not read may be
unterminated, and appending to that makes the next sheet part of its last
rule. A sheet after the first carrying `@import` is left alone too, since an
import only applies at the top of a sheet. @swc/html, the only other tool
that folds by default, gets both of those wrong.

`removeEmptyAttributes` drops `class` / `id` / `style` / `dir` when the value
is empty, which is the state the spec also gives their absence. Off by
default: a presence selector still matches an empty value. `title` and `lang`
are deliberately not in the table even though every other minifier drops them
— the spec gives an empty `title` the meaning "no advisory information",
overriding an ancestor's, and an empty `lang` the meaning "language unknown"
rather than the inherited one.
@alexander-akait
feat(html): drop repeated token-list values, and offer sorting
fe5ca55
A token list is a set — the ordered set parser drops a repeat — so a
repeated `class` token was never a second token, and the value is already
rewritten in place next to this. Sorting is not free that way: nothing in
HTML or CSS reads attribute or class order, but a script reading
`element.attributes` or `className` back does, so `sortAttributes` and
`sortClassNames` are opt-in. Both are reorderings only — the byte count is
unchanged and a test pins that, alongside one comparing the canonical DOM
of the sorted output against the unsorted.
@alexander-akait
feat(html): offer dropping an element that carries nothing
8f71d84
Every guard but the name table is a rule rather than a list: a void
element is childless by definition, a template's children hang off a
content fragment, foreign content is not ours to judge, and an element
spelling any attribute was written for a reason. That last one is what
keeps <script src>, <iframe src> and <div id=mount>, each of which
html-minifier-terser drops; the table adds the elements whose bare form
is still doing a job, including the table structure, where dropping a
cell shifts every one after it.
@alexander-akait
fix(html): drop a redundant attribute the source left unquoted
655e827
The check sat inside the quoted-value branch, so `<style type=text/css>`
kept its marker while `<style type="text/css">` lost it. Hoisted above
that branch, where the raw value is already known either way.

Also backtick `@swc/html` in the schema description: bare, it reads as a
JSDoc tag and truncates the generated sentence at that word.
@alexander-akait
feat(html): omit a source-spelled <html> / <head> / <body>
2fdf038
Only implied ones were transparent before, so a page that spelled the
wrappers kept every one of them. §13.1.2.4 gives each start tag its own
condition; the end tags join the tables already there, with `</head>`
sharing caption's rule. Both halves must hold before either goes.

Two things the conditions read that the spec's prose does not spell out:
whitespace the minifier is certain to drop cannot block anything, so
`</head>` reads past the newline every pretty-printed page has after it;
and the elements that block a `<body>` start tag are derived from
HEAD_ELEMENTS rather than from the five §13.1.2.4 names, which miss
`<title>` and `<noscript>` and would move both into the head.

-27 bytes on html5-boilerplate and on swagger-ui.
@alexander-akait
feat(html): fold an enumerated attribute value to lower case
0aba226
An enumerated attribute matches its keywords ASCII-case-insensitively, so
folding one changes nothing the DOM reads — the same ground the token-list
and integer rewrites next to it already stand on, so it needs no option.

Only a value that *is* one of the keywords folds. That is what keeps
target="MyFrame" and a custom type="MyThing" exactly as written, and it is
why the table carries the keyword sets rather than just the attribute
names. <ol type> is left out entirely: A and a are two different keywords
there, so folding one into the other renumbers the list.

The table is spec prose — nothing in the IDL marks an attribute as
enumerated — so a test drives every entry, and a second, hand-written one
pins the entry list so a deletion cannot pass unnoticed.
@alexander-akait
feat(html): add collapse modes, comment options, empty metadata
acc5d3c
Four transforms the other minifiers offer and this one did not:

collapseWhitespace grows past its single mode. `true` still means
"conservative" and still never removes whitespace; "smart" also drops what
sits against a block element's edge, where no line box reaches it, and
"all" drops every text node's edges. "smart" reads a block-level table
from §15's rendering stylesheet, and only looks forward — a block sibling
*behind* the whitespace would let it go too, but finding one costs a scan
of the whole child list, so it keeps a space rather than pay that.

preserveComments names comments to keep on top of the ones minifying
always keeps. removeEmptyElements now also drops a void element that
belongs in the head, derived as HEAD_ELEMENTS intersected with VOID:
with no attributes a <meta> or <link> states nothing.

minifyConditionalComments minifies the markup inside a downlevel-hidden
comment. The printer cannot do it where it sits — only one HTML parse
runs at a time — so the bodies are collected in a walk of their own and
spliced in by exact source text, never by a pattern over the output,
which would find a <!--[if written inside a script.
@alexander-akait
perf(html): answer the value-rewrite chain with one lookup
1d4d2b0
Measured against the merge base on a 706 KB, 28000-attribute page, in
separate alternating processes: the batch of new transforms cost +19%
CPU. This brings that to +10%, and retained heap is unchanged throughout.

The chain in `_rewriteAttributeValue` asked six tables in turn whether
they knew an attribute name, and the enumerated fold had made it seven.
Nearly every attribute on a page — a `data-*`, an `id`, an `aria-*`, a
`role` — is in none of them, so it paid all seven misses. One generated
union of those names now answers for the whole chain, which leaves those
attributes cheaper than they were before any of this.

Three smaller ones alongside it: the two element-keyed tables the
redundancy check reads are looked up once per element rather than once
per attribute, the token-list duplicate check reads spans in place
instead of cutting the list up, and the structural-tag check tests the
element name before anything else.
@alexander-akait
fix(html): follow the base branch's rename of the print mode
661d0a5
The rebase landed on top of a change that replaced `minimize: true` with
`mode: "minify"` and dropped the map. Two callers this branch added still
spelled the old one: the nested pass over a conditional comment's body,
and six unit tests, which stopped printing rather than failing.
@alexander-akait
alexander-akait force-pushed the feat/html-remove-redundant-attributes branch from ea2e585 to 661d0a5 Compare August 12, 2026 08:53
@alexander-akait
docs(html): say what "smart" preserves, not more
80c901a
The option claimed to drop only markers nothing a selector or a script
can observe, and that is not true: `querySelector('style[type]')` can
tell one went. What actually separates the tier from "all" is narrower —
every marker in it sits on an element that renders nothing, so no rule
that styles the page stops applying, whereas "all" drops
`input[type=text]`, which stylesheets really do select on. Both the
schema description and the generated table now say that instead.
alexander-akait added 3 commits August 12, 2026 10:00
@alexander-akait
perf(html): collect conditional comments on the printing walk
1d6996d
`minifyConditionalComments` parsed the document twice: once with a
visitor to find the comments, then again to print. A visitor rides the
same walk that prints, so the first pass was never needed — the option
now costs 2% over a document that has one, rather than a second parse of
every document it is enabled for.

The bodies still get their own processor. The collector is registered on
the document's, and a conditional comment nested in one would write into
the map being read.
@alexander-akait
refactor(html): minify a conditional comment with the one processor
793fbc1
The second one only existed so a body could be minified without the
collector visitor attached to it. A flag says the same thing: it stops
recording once the document has printed, so nothing a body contains can
write into the map being read.
@alexander-akait
refactor(util): let each language name its own print options
6546bdd
`PrintOptions` sat in the shared SourceProcessor and enumerated both
languages' entries — CSS's `convertLengthUnits` next to HTML's
`sortClassNames` — so every option added to either edited a file the
other depends on, and `process` copied each one across by hand. The base
now carries `mode` alone and PrintContext takes the language's own type,
which CSS and HTML each name once.

`environment` and `convertLengthUnits` do reach the HTML minifier, and
should: an inline `<style>` and every `style=""` run through the CSS
minifier, so `optimization.minimize.css` rides along to reach it. They
are not HTML options — the schema has never accepted either under
`optimization.minimize.html` — and `HtmlPrintOptions` now says so by
picking them off `CssProcessOptions` instead of restating them.
@github-actions github-actions Bot added the area: css CSS support (lib/css) label Aug 12, 2026
alexander-akait added 3 commits August 12, 2026 10:41
@alexander-akait
test(html): type the collapse modes and the wrapper list
c905da0
`lint:types-test` runs tsc over test/, and neither annotation was there:
the mode was widened to `string`, which stopped matching the option's
union and resolved `process` to no overload at all.
@alexander-akait
revert(html): keep a source-spelled <html> / <head> / <body>
51f4d99
Omitting them relies on §13.1.2.4 tag inference, which is a guarantee of
a browser's parser and not of everything that reads HTML — an email
client, a template engine, a post-processor matching on the output. A
page that spells the wrappers keeps them again; a parser-implied one is
still printed without them, as it was before.

Reverts the transform, its tables (BODY_START_TAG_BLOCKERS,
OPTIONAL_END_TAG_UNLESS_COMMENT, and `head` in the caption rule) and the
whitespace-lookahead the `</head>` condition needed. Gives back the 27
bytes it saved on html5-boilerplate and on swagger-ui.
@alexander-akait
fix(html): make every minify default DOM-preserving
0ef9dbe
Only a transform nothing can observe stays unconditional. Dropping a
redundant attribute and folding a run of adjacent <style> both change
what the engine builds, so each is now an option that is off by default
(`removeRedundantAttributes`, `mergeStyles`). A repeated token goes only
from a list the DOM reflects as a DOMTokenList, and an enumerated value
folds only where the IDL member is limited to only known values, so
`target` / `formtarget` / <area shape> / <textarea wrap> keep their case.

Also fixes the newline after an empty <pre> / <textarea>: the swallow
offer stood until the next text token instead of the next token.

The browser-equivalence suite now covers all of it — it compares the
value each attribute reflects, and checks every enumerated keyword
against the engine rather than only the ones a fixture carries.
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging feat/html-remove-redundant-attributes into main will be
99.26%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.82%100%100%98.82%103
examples
   build-common.js100%100%100%100%
   buildAll.js100%100%100%100%
   examples.js100%100%100%100%
   template-common.js98.21%100%100%98.21%72
examples/custom-javascript-parser
   test.filter.js100%100%100%100%
examples/custom-javascript-parser/internals
   acorn-parse.js100%100%100%100%
   meriyah-parse.js100%100%100%100%
   oxc-parse.js100%100%100%100%
examples/markdown
   webpack.config.mjs100%100%100%100%
examples/module-federation
   test.filter.js100%100%100%100%
examples/reexport-components
   test.filter.js100%100%100%100%
examples/typescript
   test.filter.js100%100%100%100%
examples/typescript-non-erasable
   test.filter.js50%100%100%50%5
examples/virtual-modules
   test.filter.js100%100%100%100%
examples/wasm-bindgen-esm
   test.filter.js100%100%100%100%
examples/wasm-complex
   test.filter.js100%100%100%100%
examples/wasm-emscripten
   test.filter.js100%100%100%100%
examples/wasm-simple
   test.filter.js100%100%100%100%
examples/wasm-simple-source-phase
   test.filter.js100%100%100%100%
lib
   APIPlugin.js100%100%100%100%
   AsyncDependenciesBlock.js100%100%100%100%
   AutomaticPrefetchPlugin.js100%100%100%100%
   BannerPlugin.js100%100%100%100%
   Cache.js98.21%100%100%98.21%101
   CacheFacade.js100%100%100%100%
   Chunk.js99.72%100%100%99.72%39
   ChunkGraph.js100%100%100%100%
   ChunkGroup.js100%100%100%100%
   ChunkTemplate.js100%100%100%100%
   CircularModulesPlugin.js98.81%100%100%98.81%136
   CleanPlugin.js99.12%100%100%99.12%214, 234
   CodeGenerationResults.js100%100%100%100%
   CompatibilityPlugin.js100%100%100%100%
   Compilation.js98.44%100%100%98.44%1673, 1992, 1999, 2007, 2029, 2032, 2971, 3450–3451, 3483, 4192, 4222, 4275–4276, 4280, 4285, 4301–4302, 4316–4317, 4322–4323, 4843, 4869, 549, 554, 5679, 5711, 5728, 5746, 5762, 5777, 5802–5803, 5805, 6140, 6145, 6151, 6154, 6161, 6173, 6175, 6179, 6197, 6212, 6246, 6302, 6326, 6442, 801–802
   Compiler.js99.56%100%100%99.56%1168–1169, 1177
   ConcatenationScope.js99.12%100%100%99.12%300
   ConditionalInitFragment.js100%100%100%100%
   ConstPlugin.js100%100%100%100%
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js99.88%100%100%99.88%1461
   ContextModuleFactory.js97.20%100%100%97.20%266, 435, 456, 461, 501, 512, 514, 518, 527–528
   ContextReplacementPlugin.js100%100%100%100%
   DefinePlugin.js99.08%100%100%99.08%1080, 176–177, 193, 212, 286
   DependenciesBlock.js100%100%100%100%
   Dependency.js98.51%100%100%98.51%480, 527
   DependencyTemplate.js100%100%100%100%
   DependencyTemplates.js100%100%100%100%
   DotenvPlugin.js98.41%100%100%98.41%378, 391–392
   DynamicEntryPlugin.js100%100%100%100%
   EntryOptionPlugin.js100%100%100%100%
   EntryPlugin.js100%100%100%100%
   Entrypoint.js100%100%100%100%
   EnvironmentPlugin.js97.14%100%100%97.14%49
   ErrorHelpers.js100%100%100%100%
   EvalDevToolModulePlugin.js100%100%100%100%
   EvalSourceMapDevToolPlugin.js100%100%100%100%
   ExportsInfo.js100%100%100%100%
   ExportsInfoApiPlugin.js100%100%100%100%
   ExternalModule.js98.67%100%100%98.67%1220, 1223, 519–523, 525, 671
   ExternalModuleFactoryPlugin.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js99.53%100%100%99.53%186, 2454–2455, 2458, 2469, 2480, 2491, 284, 3928, 3943, 3967
   FlagAllModulesAsUsedPlugin.js100%100%100%100%
   FlagDependencyExportsPlugin.js98.36%100%100%98.36%504, 513, 516, 520, 532
   FlagDependencyUsagePlugin.js100%100%100%100%
   FlagEntryExportAsUsedPlugin.js100%100%100%100%
   Generator.js100%100%100%100%
   HotModuleReplacementPlugin.js100%100%100%100%
   HotUpdateChunk.js100%100%100%100%
   IgnorePlugin.js100%100%100%100%
   IgnoreWarningsPlugin.js100%100%100%100%
   InitFragment.js100%100%100%100%
   JavascriptMetaInfoPlugin.js100%100%100%100%
   LazyBarrel.js100%100%100%100%
   LibraryTemplatePlugin.js100%100%100%100%
   LoaderOptionsPlugin.js100%100%100%100%
   LoaderTargetPlugin.js100%100%100%100%
   MainTemplate.js100%100%100%100%
   ManifestPlugin.js100%100%100%100%
   Module.js98.51%100%100%98.51%1303, 1308, 1368, 1382, 1444, 1453
   ModuleFactory.js100%100%100%100%
   ModuleFilenameHelpers.js98.90%100%100%98.90%111, 113
   ModuleGraph.js99.78%100%100%99.78%1170
   ModuleGraphConnection.js100%100%100%100%
   ModuleInfoHeaderPlugin.js100%100%100%100%
   ModuleNotFoundError.js100%100%100%100%
   ModuleProfile.js100%100%100%100%
   ModuleSourceTypeConstants.js100%100%100%100%
   ModuleTemplate.js100%100%100%100%
   ModuleTypeConstants.js100%100%100%100%
   MultiCompiler.js99.72%100%100%99.72%721
   MultiStats.js100%100%100%100%
   MultiWatching.js100%100%100%100%
   NoEmitOnErrorsPlugin.js100%100%100%100%
   NodeStuffPlugin.js100%100%100%100%
   NormalModule.js97.99%100%100%97.99%1027, 1030, 1047, 1064, 1312, 1346, 1362, 1817, 2114, 2119–2129, 29
   NormalModuleFactory.js98.77%100%100%98.77%1142, 1410, 1421, 1431, 1482–1484, 1491, 536, 548
   NormalModuleReplacementPlugin.js100%100%100%100%
   NullFactory.js100%100%100%100%
   OptimizationStages.js100%100%100%100%
   OptionsApply.js100%100%100%100%
   Parser.js100%100%100%100%
   PlatformPlugin.js100%100%100%100%
   PrefetchPlugin.js100%100%100%100%
   ProgressPlugin.js99.80%100%100%99.80%690
   ProvidePlugin.js100%100%100%100%
   RawModule.js100%100%100%100%
   RecordIdsPlugin.js100%100%100%100%
   RequestShortener.js100%100%100%100%
   ResolverFactory.js100%100%100%100%
   RuntimeGlobals.js100%100%100%100%
   RuntimeModule.js100%100%100%100%
   RuntimePlugin.js95.69%100%100%95.69%310, 366, 375, 378, 402, 420, 441–442, 465, 485–486, 522–523, 546, 559–560, 632, 645, 666, 685
   RuntimeTemplate.js99.83%100%100%99.83%164, 2363
   SelfModuleFactory.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   SourceMapDevToolModuleOptionsPlugin.js100%100%100%100%
   SourceMapDevToolPlugin.js98.63%100%100%98.63%220, 224, 226, 420, 431, 890
   Stats.js100%100%100%100%
   Template.js100%100%100%100%
   TemplatedPathPlugin.js99.48%100%100%99.48%364–365
   UseStrictPlugin.js100%100%100%100%
   WarnCaseSensitiveModulesPlugin.js100%100%100%100%
   WarnDeprecatedOptionPlugin.js100%100%100%100%
   WarnNoModeSetPlugin.js100%100%100%100%
   WatchIgnorePlugin.js100%100%100%100%
   Watching.js100%100%100%100%
   WebpackError.js100%100%100%100%
   WebpackIsIncludedPlugin.js100%100%100%100%
   WebpackOptionsApply.js100%100%100%100%
   WebpackOptionsDefaulter.js100%100%100%100%
   buildChunkGraph.js99.87%100%100%99.87%376
   cli.js98.63%100%100%98.63%10, 119, 549, 581, 631, 905
   index.js99.73%100%100%99.73%184
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
   webpack.js97.12%100%100%97.12%10, 267, 289, 291
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js100%100%100%100%
   AssetGenerator.js100%100%100%100%
   AssetModule.js100%100%100%100%
   AssetModulesPlugin.js98.15%100%100%98.15%330, 354, 357, 487, 49, 54
   AssetParser.js100%100%100%100%
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js100%100%100%100%
   RawDataUrlModule.js100%100%100%100%
   WebManifestGenerator.js100%100%100%100%
   WebManifestParser.js100%100%100%100%
lib/async-modules
   AsyncModuleHelpers.js100%100%100%100%
   AwaitDependenciesInitFragment.js100%100%100%100%
   InferAsyncModulesPlugin.js100%100%100%100%
   isGeneratorLowered.js100%100%100%100%
lib/bun
   BunTargetPlugin.js100%100%100%100%
lib/cache
   AddBuildDependenciesPlugin.js100%100%100%100%
   AddManagedPathsPlugin.js100%100%100%100%
   IdleFileCachePlugin.js97.92%100%100%97.92%75, 87, 95
   MemoryCachePlugin.js92%100%100%92%34, 43
   MemoryWithGcCachePlugin.js93.42%100%100%93.42%108, 122–123, 132, 90
   PackFileCacheStrategy.js96.52%100%100%96.52%1310, 1410, 1414, 1476, 1712, 1796, 1819, 1851, 675, 694, 704–706, 708, 724–725, 730, 733, 735, 740, 745, 770, 776,
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait merged commit 9db1341 into main Aug 12, 2026
62 of 64 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait deleted the feat/html-remove-redundant-attributes branch August 12, 2026 14:07
@github-actions github-actions Bot mentioned this pull request Aug 12, 2026
chore(release): new release #21545
Merged
@aryanraj45 aryanraj45 mentioned this pull request Aug 12, 2026
fix(html): read past the whitespace collapseWhitespace removes when omitting an end tag #21694
Closed
This was referenced Aug 13, 2026
feat(html): leave out the implied <html> tag, and align the minify option surface #21700
Merged
fix(html): drop a shell tag kept for whitespace that prints nothing, and respell escaped quotes #21717
Merged
perf(html): cut the minifier's hot paths on attribute-heavy markup #21731
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area: config Options, defaults, validation (lib/config, schemas/) area: css CSS support (lib/css) area: html Experimental HTML support (lib/html) area: tooling Repo tooling, codegen, CLI entry (tooling/, bin/) area: types types.d.ts, JSDoc annotations, hand-maintained declarations

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@alexander-akait
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.