vite-svg
vite-svg copied to clipboard
Config for pragma and jsxRuntime enabling preact
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',
}),
],
})