Use svgr to transform your SVGs into React components with Snowpack
npm install snowpack-plugin-svgr> Use svgr to transform your SVGs into React components with Snowpack
``sh`
npm i -D snowpack-plugin-svgr
---
`js`
// snowpack.config.json
{
"plugins": [["snowpack-plugin-svgr", { / see "Plugin Options" below / }]]
}
#### Plugin Options
`typescript@svgr/core
interface SnowpackPluginSvgrOptions {
/**
* Includes only the specified paths
*/
include?: string[]
/**
* Excludes the specified paths
*/
exclude?: string[]
/**
* These options are passed directly to babel.transformAsync()
*/
babelOptions?: TransformOptions
/**
* These options are passed directly to 's convert() function``
* See: https://react-svgr.com/docs/options/
*/
svgrOptions?: any
}
MIT