Skip to content

Conversation

@charlyisidore
Copy link

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.

@huacnlee
Copy link

huacnlee commented Aug 14, 2025

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

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

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.

2 participants