-
Notifications
You must be signed in to change notification settings - Fork 171
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
[Bug]: Unicode Character Transformation in CSS Files #3328
Comments
This is caused by Lightning CSS. In Rsbuild you can disable lightningcss-loader by setting tools.lightningcssLoader to false. You can also use rsbuild-plugin-css-minimizer to switch Lightning CSS to another CSS minimizer. |
Disabling lightningcss fixes the issue in development environment but the issue is present in production build How can I tell rsbuild to keep characters as they are in production? |
Use other CSS minimizers |
so lightningcss has some bugs while this package can't fix these timely, how can rsbuild improve its QOS when we find some corner case then just wait or turn off lightningcss in our configs? @chenjiahan lightningcss has 200+ unresolved issues which means there are so many edge cases that we can't find out in production |
We will help Lightning CSS fix critical issues. Considering that Lightning CSS has been adopted by Next.js, Turbopack, Parcel, Rspack, Vite, Rolldown, I believe these issues will be solved. |
@amirsarfarW even with unicode character was transformed uncorrectly, but maybe work well? I tested in some mobile(ios 11、chrome39) |
if you check parcel-bundler/lightningcss#310 there is no issue in most cases but when the css is cached by chrome the characters get weird it is an issue with chome and lightning css and none of them are fixing their issue |
我使用了web-infra-dev/rspack#6057 中提到的解决方案实现打包后css不乱码的。但是经过compression-webpack-plugin压缩为gz或br包后发现content仍然会被解析为不可读字符。所以采用了分开打包相应的css文件同时排除压缩打包后的css文件这种方式来解决这个问题。目前看css的content会正确显示不再被解析为不可读字符,若有更优雅的实现方式欢迎与我交流。 |
Version
Details
I have this issue in font icons
I have this style:
Rsbuild produces this in dev and prod:
This has some issues when the css file is cached by the browser
Some similar issues:
GoogleChrome/lighthouse#10060
parcel-bundler/lightningcss#310
I have searched a lot and there is no way to prevent rsbuild from transforming unicode to character
Reproduce link
https://codepen.io/Justineo/pen/yLbxxOR
Reproduce Steps
Simply create a new project with rsbuild
Have something like this in your css:
then check the outputs in dev and prod:
The text was updated successfully, but these errors were encountered: