Skip to content

Latest commit

 

History

History

rollup-plugin-react-svg

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

rollup-plugin-react-svg

Load SVG images as React Components

Install

npm i rollup-plugin-react-svg --save-dev

# or with yarn

yarn add rollup-plugin-react-svg --dev

Usage

// rollup.config.js
import reactSvg from "rollup-plugin-react-svg";

export default {
  ...opts,
  plugins: [
    ...plugins,

    reactSvg({
      // svgo options
      svgo: {
        plugins: [], // passed to svgo
        multipass: true
      },

      // whether to output jsx
      jsx: false,

      // include: string
      include: null,

      // exclude: string
      exclude: null
    })
  ]
}

LICENSE

MIT