docs: prefer the object form of minify, and list webpack's own minimizers first - #728
Conversation
…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
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Summary
The README still led with
minifyas a bare function or an array and documentedminimizerOptionsat 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.minifyis now documented asobject→array→function, in that order, withminimizerOptionscut to a short deprecated note pointing at it.webpack's own
cssMinifyandhtmlMinifywere 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 aboutcssnanoandhtml-minifier-terserare dropped — neither is a default,terserMinifyis the only one. The custom minify examples show the properties a minifier declares about itself (getTypes, andgetEmbeddedTypeswithrenderEmbeddedSourcefor 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.
minimizerOptionsandterserOptionsare 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 stripsecmaandmodulebefore callinguglify-js, which rejects options it does not know.🤖 Generated with Claude Code
https://claude.ai/code/session_016TQeNpahUSDUjD2Crugy5H
Generated by Claude Code