damianstasik / vite-svg

Use SVG files as Vue components with Vite
MIT License
105 stars 14 forks source link

Config for pragma and jsxRuntime enabling preact #76

Closed wezzle closed 11 months ago

wezzle commented 2 years ago

Setting the pragma to h and the jsxRuntime to classic-preact allows this plugin to be used for preact projects.

Example config:

import preact from '@preact/preset-vite'
import svg from 'vite-plugin-react-svg'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    preact(),
    svg({
      defaultExport: 'component',
      pragma: 'h',
      jsxRuntime: 'classic-preact',
    }),
  ],
})