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

fix: lightningCss default target use browserslist set #7868

Conversation

noshower
Copy link
Contributor

一些流行的库都是使用 browerslist 来配置 target, 例如 Babelpostcss-preset-env

当前,rspack. LightningCssMinimizerRspackPlugin target 选项的默认值是”fully supports es6“,与 postcss-preset-env 默认 target 配置存在不一致。这种不一致,可能会让同时使用 postcss-loader 和 rspack.LightningCssMinimizerRspackPlugin 项目存在潜在问题。

因此,期望将 rspack. LightningCssMinimizerRspackPlugin 的 minimizerOptions 配置中的 target, 默认值也由 browerslist 指定。

此 PR 可能会引入破坏性更改,原因是项目未显示配置 target ,同时未使用 browserslist 的项目,target 默认值的兼容性会低于原先的 ”fully supports es6“。

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

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Sep 11, 2024
Copy link

netlify bot commented Sep 11, 2024

Deploy Preview for rspack ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4abb856
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/66e1ae11309cde00098eeedf
😎 Deploy Preview https://deploy-preview-7868--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.

@@ -37,7 +38,7 @@ export const LightningCssMinimizerRspackPlugin = create(
): RawLightningCssMinimizerRspackPluginOptions => {
const { include, exclude, draft, nonStandard, pseudoClasses } =
options?.minimizerOptions ?? {};
const targets = options?.minimizerOptions?.targets ?? "fully supports es6"; // last not support es module chrome version
const targets = options?.minimizerOptions?.targets ?? browserslist(null);
Copy link
Member

Choose a reason for hiding this comment

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

If there is no browserslist config, I think we should not change the default "fully supports es6". It is a potentially breaking change.

Copy link
Member

@chenjiahan chenjiahan Sep 12, 2024

Choose a reason for hiding this comment

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

And we should resolve the browserslist config in the Rust side for better performance. Similar to #7544

@noshower noshower closed this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants