Skip to content

docs: prefer the object form of minify, and list webpack's own minimizers first - #728

Merged
alexander-akait merged 2 commits into
mainfrom
docs/prefer-minify-object-form
Sep 6, 2026
Merged

docs: prefer the object form of minify, and list webpack's own minimizers first#728
alexander-akait merged 2 commits into
mainfrom
docs/prefer-minify-object-form

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Summary

The README still led with minify as a bare function or an array and documented minimizerOptions at full length, so the shape we want people to write — a minimizer and its own options in one object — was the least visible of the three. minify is now documented as objectarrayfunction, in that order, with minimizerOptions cut to a short deprecated note pointing at it.

webpack's own cssMinify and htmlMinify were missing from the top-of-README lists and last in the per-language ones, despite needing no extra dependency and being the only ones that minify what a document or a stylesheet nests; they now head the CSS and HTML lists. The two "the default CSS/HTML minimizer" claims about cssnano and html-minifier-terser are dropped — neither is a default, terserMinify is the only one. The custom minify examples show the properties a minifier declares about itself (getTypes, and getEmbeddedTypes with renderEmbeddedSource for one that nests other languages), and the migration guide gains a worked minimizer before/after next to the generator one.

What kind of change does this PR introduce?

docs

Did you add tests for your changes?

n/a — documentation only.

Does this PR introduce a breaking change?

No. Nothing in the code changes, and every form documented before is still accepted.

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

Everything is in this PR. minimizerOptions and terserOptions are marked deprecated in it, to be removed in the next major release.

Use of AI

Claude Code wrote the README changes, working from the plugin's schema, its option handling and the built-in minimizers' declarations; I reviewed them before submitting. One example was corrected against uglifyJsMinify's own behaviour — it now strips ecma and module before calling uglify-js, which rejects options it does not know.

🤖 Generated with Claude Code

https://claude.ai/code/session_016TQeNpahUSDUjD2Crugy5H


Generated by Claude Code

alexander-akait and others added 2 commits September 6, 2026 11:26
…mizers first

`minify` is documented as an object first — the minimizer and its own
options in one place — with the array kept for several minimizers and the
bare function as shorthand. `minimizerOptions` is cut to a short deprecated
note pointing at it.

webpack's own `cssMinify` and `htmlMinify` head the CSS and HTML lists,
where they were missing or last, and the custom minify examples show the
properties a minifier declares: `getTypes`, and `getEmbeddedTypes` with
`renderEmbeddedSource` for one that nests other languages.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016TQeNpahUSDUjD2Crugy5H
The guide worked an example of a generator only, so the one option that
carries over unchanged — `minimizer` to `minify`, same object — was left to
the table alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016TQeNpahUSDUjD2Crugy5H
@changeset-bot

changeset-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3bcc72d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.10%. Comparing base (a2c490a) to head (3bcc72d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #728   +/-   ##
=======================================
  Coverage   95.10%   95.10%           
=======================================
  Files           4        4           
  Lines        1329     1329           
  Branches      483      483           
=======================================
  Hits         1264     1264           
  Misses         57       57           
  Partials        8        8           

☔ 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.

@alexander-akait
alexander-akait merged commit b018da7 into main Sep 6, 2026
31 checks passed
@alexander-akait
alexander-akait deleted the docs/prefer-minify-object-form branch September 6, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant