-
Notifications
You must be signed in to change notification settings - Fork 22
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
Create SVG sprite build process within the VUE branche (webpack?) #56
Comments
Cleaned up SVG files and put them in |
How's the progress on this? |
No movement yet, been absent for holidays. Will look into this in the coming week. |
After multiple failed attempts, I'm throwing my hands in the air 😭 Having a hell of a time getting this running as my webpack-fu is weak. Since we've got SVG's working inline with external references, I see this as a "nice to have". Going to mark help-wanted and on-hold until one of us either has time to give it another go, or has a breakthrough. |
@Zetaphor would it be weird to run |
Hi guys, this seems a bit old, but I was thinking about a solution for this when browsing through the project. I am not sure, if I have understood it right, but you want to directly load the svgs to the SvgContainer.vue through the webpack generated links? And the svgs should already have the id attribute with their respective name, something like that? I am not sure, if following works and I have not looked too deep into the project to know how to directly try it out. Nonetheless, I will describe my possible solution, it may work: You need to install 2 packages for it to theoretically work: image-loader and an inline-svg-plugin for webpack. After that, through the former package you have to edit your webpack conf like following:
You will see examples for this in the image-loader package. With the inline-svg-plugin we will load the svg files into the SvgContainer.vue file. First add the plugins to the webpack config:
And than you can easily include the pure svg string like an img into
Every step is purely from the documentation of all above mentioned packages. I have no clue whether this will work, but maybe someone wants to try out (This someone may also be me ^^). |
A build process for importing all the SVG files used on the site within the
SvgContainer.vue
file and have the ID be the file name of the SVG, like so<svg id="{{filename}}>....</svg>
.Because we're using Webpack it would be nice to implement it within this.
The text was updated successfully, but these errors were encountered: