vite-svg icon indicating copy to clipboard operation
vite-svg copied to clipboard

Config for pragma and jsxRuntime enabling preact

Open wezzle opened this issue 2 years ago • 0 comments

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',
    }),
  ],
})

wezzle avatar Feb 08 '22 18:02 wezzle