Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Latest commit

 

History

History

libuild-plugin-svgr

@modern-js/libuild-plugin-svgr

npm version

A plugin for libuild to transform your svg to react component

Usage

// libuild.config.ts
import { defineConfig } from '@modern-js/libuild';
import { svgrPlugin } from '@modern-js/libuild-plugin-svgr';

export = defineConfig({
  plugins:[
    svgrPlugin( { /* options here */ })
  ]
})

Options

include

The include option is a glob pattern to match the svg files you want to transform, default is /\.(svg)$/

exclude

The exclude option is a glob pattern to match the svg files you don't want to transform, default is undefined

other options

See here for svgr options