Skip to content

Svg support 2 #78

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

Merged
merged 7 commits into from
Jul 6, 2021
Merged

Svg support 2 #78

merged 7 commits into from
Jul 6, 2021

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jul 3, 2021

Add support for importing .svg files as Svelte components when using extensions: ['.svelte', '.svg']. (Supersedes #50)

Changes

  1. vite-plugin-svelte will load SVGs from the filesystem if one of the extensions ends with .svg.
  2. Added new custom-extensions e2e-test to test custom extension Svelte components in general, currently .svg only.

Notes

  1. Vite intercepts SVG loading by default with its asset plugin, this prevents extensions like .svg to load as Svelte components. This PR loads the file manually to prevent the above.

@dominikg dominikg merged commit 2eb09cf into sveltejs:main Jul 6, 2021
@github-actions github-actions bot mentioned this pull request Jul 6, 2021
@github-actions github-actions bot mentioned this pull request Jul 13, 2022
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.

2 participants