poppa / sveltekit-svg

SvelteKit plugin that makes it possible to import SVG files as Svelte components, inline SVG code or urls
MIT License
235 stars 23 forks source link

use for server side SVG? #64

Closed dcsan closed 2 months ago

dcsan commented 2 months ago

I'd like to generate a pure SVG file without and <html> wrapper. eg from a +page.server.. URL

(actually trying to use the SVG as a template to import into an <mg tag to allow pan/zoom. )

can I use this plugin to do that with sveltekit?

I've placed any layout files out of the page and also tried removing anything from app.html but I still get a wrapper around any content.

forgive me if this is a bit more of a general sveltekit question and thanks for any help!

poppa commented 2 months ago

I guess you could just create a +server.js and simply return a string with the image/svg+xml content type set in the reponse header. But that's not related to this plugin so...