Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add minify option to lightningcss-loader #7653

Merged

Conversation

witsaint
Copy link
Contributor

Summary

When we use buildin:lightningcss,The production code can only be compressed from the rule,Code space cannot be compressed, such as cssnano's normalizewhitespace feature

for the following reason

image

The first argument to the stylesheet.to_css method is a fixed false,

So,When we use rspack or rebuild, do we use lightningcss compression capabilities to the user,

At the same time, rsbuild can increase the scalability when built-in that

rsbuild issure#3247

Checklist

  • [✅] Tests updated (or not required).
  • [✅] Documentation updated (or not required).

Copy link

netlify bot commented Aug 22, 2024

Deploy Preview for rspack ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5b92720
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66c73d0dfdf9980008ca146f
😎 Deploy Preview https://deploy-preview-7653--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@witsaint witsaint changed the title Add lightningcss minify option feat Add lightningcss minify option Aug 22, 2024
@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Aug 22, 2024
@witsaint witsaint changed the title feat Add lightningcss minify option feat: Add lightningcss minify option Aug 22, 2024
@chenjiahan chenjiahan changed the title feat: Add lightningcss minify option feat: add minify option to lightningcss-loader Aug 22, 2024
@chenjiahan chenjiahan requested a review from ahabhgk August 22, 2024 08:36
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍🏻

This option is useful when using style-loader, as the built-in LightningCssMinimizerRspackPlugin can not handle CSS files injected by style-loader, and users can use this option to minify CSS.

@chenjiahan chenjiahan merged commit 2d18cc2 into web-infra-dev:main Aug 22, 2024
28 checks passed
@chenjiahan chenjiahan mentioned this pull request Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants