Open priority3 opened 2 months ago
The special processing of ~
import in less-loader causes ~@animate
to be processed into @animate/
, which is a special case.
see: https://github.com/webpack-contrib/less-loader/blob/master/src/utils.js#L75-L77
The special processing of
~
import in less-loader causes~@animate
to be processed into@animate/
, which is a special case. see: webpack-contrib/less-loader@master
/src/utils.js#L75-L77
yeah, thks so mush ! This helped me solve the problem very well; just replace the @animate
to @animate/
in rsbuild.config.ts / alias
everything is working; but after my testing, this issue only appeared after upgrading to version 1.0, and was completely normal in previous versions.
This error occurs because rspack uses the native parser in the loader, see https://github.com/web-infra-dev/rspack/pull/4945.
In my test, when setting the @animate
alias as below, enhance-resolve
can handle this case @animate/
=> node_modules/animate.less/animate.less
, but rspack can't handle this. @SyMind Can you help confirm whether this error in this scenario is as expected?
alias: {
"@animate": "./node_modules/animate.less/animate.less",
},
@SyMind cc
Version
Details
~
has been deprecated, But when migrating some old projects to Rsbuild, I don't want to change a lot of existing CSS file.rsbuildv0.5.9
Reproduce link
https://github.com/priority3/rebuild-less-loader/blob/main/src/App.less#L1
Reproduce Steps
change
@import '~@animate'
to@import '@animate'
everything is working.