minify-html icon indicating copy to clipboard operation
minify-html copied to clipboard

Add `lightningcss` and `minify-js` feature flags

Open charlyisidore opened this issue 8 months ago • 1 comments

This PR adds the lightningcss and minify-js feature flags to the minify-html crate.

It allows significantly lighter and faster compilation for users who don't use the provided CSS/JS minifiers. It may also help solving dependency hell issues.

Changes:

  • In minify-html/Cargo.toml, dependencies lightningcss and minify-js are optional.
  • Feature flags lightningcss and minify-js are enabled by default, therefore the current behavior is preserved.
  • In Cfg, fields minify_css and minify_js are behind feature flags.
  • Tests that use the CSS/JS minifiers are behind feature flags.

charlyisidore avatar Aug 09 '25 00:08 charlyisidore

In cargo release mode of the binary size used minify-html.

  • Those two dependencies about 10MB.
  • And minify-html-common about 9M

huacnlee avatar Aug 14 '25 11:08 huacnlee