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

Use vue-svg-loader and upgrade Vue CLI #53

Merged
merged 5 commits into from May 14, 2022
Merged

Use vue-svg-loader and upgrade Vue CLI #53

merged 5 commits into from May 14, 2022

Conversation

connorshea
Copy link
Owner

I wasn't able to upgrade Vue CLI past 5.0.0-beta.6 because beta 7 removed file-loader support, which broke html-loader. html-loader is how I've been making SVGs work because I had tried vue-svg-loader before, and it didn't work for whatever reason. Thankfully the transition from one to the other wasn't too bad, and all the weird stuff I was doing to style the SVGs still works fine with this slot hack I've updated the SvgIcon component to use.

It appears to work identically to the html-loader implementation I had
previously, but this one hopefully won't break upon subsequent upgrades
to Vue CLI.
This was very annoying to make work. Also the vglist logo doesn't
render, but that was a problem introduced by the previous commit, so
YOLO.
We don't want to treat it in a special way like the other icons, so
move it to the public directory.

I chose this solution based on these docs:
https://cli.vuejs.org/guide/html-and-static-assets.html#the-public-folder
Jest didn't know how to load the SVGs as components, so I'm having it
ignore SVGs entirely instead.
@connorshea connorshea merged commit d0971c2 into main May 14, 2022
@connorshea connorshea deleted the use-svg-loader branch May 14, 2022 19:53
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

Successfully merging this pull request may close these issues.

None yet

1 participant