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

SVG paths are not resolved #12

Open
alexandernst opened this issue Apr 28, 2023 · 0 comments
Open

SVG paths are not resolved #12

alexandernst opened this issue Apr 28, 2023 · 0 comments

Comments

@alexandernst
Copy link

I have a scss file that looks like this:

index.scss

body {
  background-image: url(@src/logo.svg);
}

When I build the project, the resulting css file will contain the same @src/logo.svg url, which is invalid.

Note that I have configured esbuild and the sassPlugin to resolve @src to the correct path.

Also note that a similar thing happens in the following case:

index.jsx

import Logo from "@src/logo.svg?url";

The resulting index.js file will contain @src/logo.svg (which is incorrect).

The correct behaviour would be to resolve the path to its final path. Eg, if my esbuild config is

assetNames: "[dir]/[name].[hash]",

then the url should look like /logo.8Fgx1Fgm.svg

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

1 participant