Open taozhou-glean opened 3 months ago
we already have url:false
BTW
{
test: /\.vanilla\.css$/i, // Targets only CSS files generated by vanilla-extract
use: [
MiniCssExtractPlugin.loader,
{
loader: require.resolve('css-loader'),
options: {
url: false, // Required as image imports should be handled via JS/TS import statements
},
},
],
},
Vanilla Extract doesn't perform any URL resolution. That's entirely up to your bundler configuration. In a test repo, I've set url: false
on css-loader
, and the following style works as expected:
export const urlTest = style({
backgroundImage:
'url(https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&w=800)',
width: '800px',
height: '800px',
});
If you could provide a minimal reproduction, that would help narrow down the issue.
oh i wonder if its because we are using relative path and it tries to resolve that compared to full absolute path 🤔
Describe the bug
Reproduction
we serve all our image assets in a public CDN, so the path set in the
url
is not the relative path to resolve the image file locally, and we don't want them to be resolved, but instead, just use the raw value, so would be nice if we have the option just like css-loader to disable the url resolvingSystem Info
Used Package Manager
pnpm
Logs
No response
Validations