Load SVG images as React Components
npm i rollup-plugin-react-svg --save-dev
# or with yarn
yarn add rollup-plugin-react-svg --dev
// 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
})
]
}