-
Notifications
You must be signed in to change notification settings - Fork 86
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
Loading svg in css files #141
Comments
Check the 'Vue Cli' tab. May help you, just the way it helped me. 😉 |
This example doesn't work with Vue3. It looks like the file-loader in my config returns an object instead of a path which looks like this:
This is maybe more related to webpack instead this plugin. |
Any follow ups? I'm experiencing same issue here. |
Yeah same problem here with Vue3 |
Same problem with Vue2 as well. Seems related to #64 and the updated docs: Edit: This might be better, but i currently got neither solutions to work. Will update when I manage to #62 (comment) |
Any updates? Have the same problem, cant find a proper solution |
I'm also very confused with how we are supposed to use SVG's in CSS with this? |
It works for me with the config from the docs (vue cli tab):
|
Using vue-cli 3 config, it is working for me using the config from the docs as mentioned by @varave, however replacing Config in
|
If someone encountered a similar problem with Nuxt, then I was able to fix it by changing: |
For anyone using Vue2, here is how I got it working with Webpack 5:
My rule in
I opted to have the In my SCSS (or CSS) files, I can use SVG backgrounds like so: And I can still import SVGs as components like normal: Webpack 5 discontinued use of |
This is my webpack config for my Vue3 project:
When i try to use a svg as background image in my css files like this:
The image in compiled stylesheet in the inspector looks like this:
Is this a bug or is my config wrong?
The text was updated successfully, but these errors were encountered: