Skip to content

Commit

Permalink
feat: export options interface
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed May 1, 2022
1 parent 21014f0 commit cde6608
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import type { Config } from '@svgr/core'
import { transformWithEsbuild } from 'vite'
import type { Plugin } from 'vite'

type Options = {
export interface ViteSvgrOptions {
svgrOptions?: Config
esbuildOptions?: Parameters<typeof transformWithEsbuild>[2]
}

export default function svgrPlugin({
export default function viteSvgr({
svgrOptions,
esbuildOptions,
}: Options = {}): Plugin {
}: ViteSvgrOptions = {}): Plugin {
return {
name: 'vite:svgr',
name: 'vite-plugin-svgr',
async transform(code, id) {
if (id.endsWith('.svg')) {
const { transform } = await import('@svgr/core')
Expand Down

0 comments on commit cde6608

Please sign in to comment.