You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7cb6dd4
Browse filesBrowse the repository at this point in the historyBrowse files
feat: export cssMinify and htmlMinify on css.syntax and html.syntax (#21953)
* feat: export cssMinify and htmlMinify on css.syntax and html.syntax
Both are written as `minify` functions for minimizer-webpack-plugin, and
both already read their parser back out of `webpack.css.syntax` at call
time, but neither was reachable from the public surface: they were absent
from `lib/index.js` and from `types.d.ts`, so the only way to pass one to
the plugin was a deep require into `lib/`.
Re-export them from the syntax modules they already depend on. Neither
minify file requires anything at module scope -- the `require("webpack")`
that resolves the parser sits inside the function body, so it survives
being shipped to the plugin's worker pool as source -- so this adds no
cycle and no load-order constraint.
* test: snapshot the minified output the export produces
Both assertions check printed code, which the testing guide says to
snapshot rather than pin with `toBe` -- a hand-written expectation over
one string ignores every other byte the printer emits. The recorded
values are unchanged.
0 commit comments