8000 Add `lightningcss` and `minify-js` feature flags by charlyisidore · Pull Request #247 · wilsonzlin/minify-html · GitHub
[go: up one dir, main page]

Skip to content
< 8000 script type="application/json" data-target="react-partial.embeddedData">{"props":{"contextRegion":{"crumbs":[{"crumb_type":"user","label":"wilsonzlin","is_root":false,"href":"/wilsonzlin"},{"crumb_type":"repository","label":"minify-html","is_root":false,"href":"/wilsonzlin/minify-html"}],"localNavigation":[{"id":"code","icon":"code","label":"Code","href":"/wilsonzlin/minify-html","selectedLinks":["repo_source","repo_downloads","repo_commits","repo_releases","repo_tags","repo_branches","repo_packages","repo_deployments","repo_attestations"],"popoverTarget":false,"commandId":"repositories:go-to-code","reactNav":{"appTarget":"code-view","anchor":"code-view-repo-link"},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"issues","icon":"issue-opened","label":"Issues","href":"/wilsonzlin/minify-html/issues","selectedLinks":["repo_issues","repo_labels","repo_milestones"],"count":65,"popoverTarget":false,"commandId":"repositories:go-to-issues","reactNav":{"appTarget":"repo","anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"pull-requests","icon":"git-pull-request","label":"Pull requests","href":"/wilsonzlin/minify-html/pulls","selectedLinks":["repo_pulls","checks"],"count":14,"popoverTarget":false,"commandId":"repositories:go-to-pull-requests","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"discussions","icon":"comment-discussion","label":"Discussions","href":"/wilsonzlin/minify-html/discussions","selectedLinks":["repo_discussions"],"popoverTarget":false,"commandId":"repositories:go-to-discussions","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"actions","icon":"play","label":"Actions","href":"/wilsonzlin/minify-html/actions","selectedLinks":["repo_actions"],"popoverTarget":false,"commandId":"repositories:go-to-actions","reactNav":{"appTarget":"repo","anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"security-and-quality","icon":"shield","label":"Security and quality","href":"/wilsonzlin/minify-html/security","selectedLinks":["security","overview","alerts","policy","token_scanning","code_scanning"],"count":0,"popoverTarget":false,"commandId":"repositories:go-to-security","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}},{"id":"insights","icon":"graph","label":"Insights","href":"/wilsonzlin/minify-html/pulse","selectedLinks":["repo_graphs","repo_contributors","dependency_graph","dependabot_updates","pulse","people","community"],"popoverTarget":false,"commandId":"repositories:go-to-insights","reactNav":{"appTarget":null,"anchor":null},"turboNav":{"frame":"repo-content-turbo-frame"}}],"localNavigationUpdateChannel":null,"selectedLink":"repo_pulls"},"owner":null,"headerLogo":{"href":"/","aria-label":"Homepage "},"notifications":{"indicatorMode":"disabled","websocketChannel":null,"fetchIndicatorSrc":"/notifications/indicator","fetchIndicatorEnabled":false},"issues":{"href":"/issues"},"pulls":{"href":"/pulls"},"contributedRepos":{"href":"/repos"},"copilot":{"show":false,"showAgentsButton":false,"showRelaunchAnnouncement":false,"copilotChatUrl":null,"copilotApiUrl":"https://api.githubcopilot.com"},"search":{"show":true,"showCommandPalette":false,"isSearchPage":false,"isJumpToSearch":false,"searchContext":{"scope":"repo:wilsonzlin/minify-html","current_repo_name":"minify-html","current_repo_nwo":"wilsonzlin/minify-html","user_id":"wilsonzlin"}},"commandPalette":null,"enterpriseBar":{"show":false},"globalTransactionalMessage":[],"payloadsUrl":"/_global-navigation/payloads.json?can_toggle_site_admin_and_employee_status=0\u0026is_admin_mode_on=0\u0026is_ui_opted_out=0\u0026show_ui_opt_out=0\u0026v=8","contextRegionUrl":null}}

Add lightningcss and minify-js feature flags - #247

Open
charlyisidore wants to merge 1 commit into
wilsonzlin:masterfrom
charlyisidore:feature-flags
Open

charlyisidore wants to merge 1 commit into
wilsonzlin:masterfrom
charlyisidore:feature-flags

Conversation

@charlyisidore
Copy link
Copy Markdown

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
huacnlee commented Aug 14, 2025 •
Copy link
Copy Markdown

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

0