Configure Vite to handle .svga files
masterIn Vite, you can treat .svga files as static assets by adding them to assetsInclude in your configuration. Use the ?url suffix to import the file path.
// vite.config.ts
import { defineConfig } from 'vite'
export default defineConfig({
assetsInclude: [
'svga'
]
})
// Usage in JS
import { Parser } from 'svga'
import xx from './xx.svga?url'
const parser = new Parser()
const svga = await parser.load(xx)