You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use rspack to bundle (and then extract) less files with our application. We don't use CSS Modules, i.e. our imports look just like import './Component.less';.
Up until v0.5.9 this resulted in these "modules" being empty (except for a use strict directive) in the bundle and they were tree shaken. But since v0.6.0 we get something like the following for every single less file in the minimized bundle which does add up to a few KB of dead code that are not tree shaken.
We're using less-loader and postcss-loader as follows and output.cssFilename and output.cssChunkFilename to load, transform and then extract these styles to separate files. newTreeShaking was enabled in v0.5.9.
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
System Info
Details
We use rspack to bundle (and then extract) less files with our application. We don't use CSS Modules, i.e. our imports look just like
import './Component.less';
.Up until v0.5.9 this resulted in these "modules" being empty (except for a
use strict
directive) in the bundle and they were tree shaken. But since v0.6.0 we get something like the following for every single less file in the minimized bundle which does add up to a few KB of dead code that are not tree shaken.We're using
less-loader
andpostcss-loader
as follows andoutput.cssFilename
andoutput.cssChunkFilename
to load, transform and then extract these styles to separate files.newTreeShaking
was enabled in v0.5.9.Reproduce link
https://github.com/web-infra-dev/rspack-repro
Reproduce Steps
I can reproduce the modules not being empty using the repro template. However they aren't tree shaken in either version there.
mode: 'production'
andexperiments.rspackFuture.newTreeshaking: true
.pnpm build:rspack
.With v0.5.9
render.css
becomes:With v0.6.0 it becomes (id adjusted for simplicity):
The text was updated successfully, but these errors were encountered: