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

[Feature]: add option to disable module prefix for css files #4662

Open
cany748 opened this issue Feb 26, 2025 · 1 comment
Open

[Feature]: add option to disable module prefix for css files #4662

cany748 opened this issue Feb 26, 2025 · 1 comment

Comments

@cany748
Copy link

cany748 commented Feb 26, 2025

What problem does this feature solve?

Now such css file does not work and gives an error. The other aliases work correctly.

.banner-help {
  background-image: url("~/assets/img/banner.jpg");
}

The problem is in this file /~https://github.com/webpack-contrib/css-loader/blob/master/src/utils.js#L471
This is expected webpack behavior, but judging from the documentation, it doesn't make sense for Rsbuild.

What does the proposed API look like?

Since there is already a patch for css-loader, you can add a new parameter like disableTildePrefix and make it default to false. This will not be a critical change.

I'd be happy to do a PR for it.

@chenjiahan
Copy link
Member

Let's wait for the response of this issue: webpack-contrib/css-loader#1629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants