web-infra-dev / rsbuild

The Rspack-based build tool. It's fast, out-of-the-box and extensible.
https://rsbuild.dev/
MIT License
1.59k stars 127 forks source link

[Bug]: css rules may disappear while using postcss-px-to-viewport-8-plugin landscape: true configuration #3692

Closed sbyps closed 21 hours ago

sbyps commented 4 days ago

Version

System: OS: macOS 14.6.1 CPU: (11) arm64 Apple M3 Pro Memory: 39.13 MB / 18.00 GB Shell: 5.9 - /bin/zsh Browsers: Chrome: 129.0.6668.91 Safari: 17.6 npmPackages: @rsbuild/core: ^1.0.13 => 1.0.13 @rsbuild/plugin-check-syntax: ^1.0.1 => 1.0.1 @rsbuild/plugin-less: ^1.0.1 => 1.0.1 @rsbuild/plugin-sass: ^1.0.2 => 1.0.2 @rsbuild/plugin-vue2: ^1.0.1 => 1.0.1

Details

run pnpm dev several times

sometimes is right Image

lightningcssLoader: false, sometimes got no landscape css rules Image

lightningcssLoader: true sometimes got no landscape css rules Image

sometimes will repeat and generate error rules Image

Reproduce link

https://github.com/sbyps/rspack-demo

Reproduce Steps

run pnpm dev several times

check the test-page.css in devtool sources

set lightningcssLoader: false run pnpm dev several times

check the test-page.css in devtool sources

chenjiahan commented 2 days ago

This is probably a problem with the postcss plugin. I see they have several open issues.

https://github.com/lkxian888/postcss-px-to-viewport-8-plugin/issues/30 https://github.com/lkxian888/postcss-px-to-viewport-8-plugin/issues/32

sbyps commented 2 days ago

This is probably a problem with the postcss plugin. I see they have several open issues.

lkxian888/postcss-px-to-viewport-8-plugin#30 lkxian888/postcss-px-to-viewport-8-plugin#32

change to another plugin cnjm-postcss-px-to-viewport, this will generate useless and error css rules Image

chenjiahan commented 2 days ago

I tried to use Vite build and get the same result:

Image

So it's still a bug of the PostCSS plugin, not the build tools.

My reproduction: https://github.com/chenjiahan/rsbuild-repro-3692