snowpack-plugin-svgr

Use svgr to transform your SVGs into React components with Snowpack

Usage no npm install needed!

<script type="module">
  import snowpackPluginSvgr from 'https://cdn.skypack.dev/snowpack-plugin-svgr';
</script>

README


snowpack-plugin-svgr

Use svgr to transform your SVGs into React components with Snowpack

npm i -D snowpack-plugin-svgr

Types Code coverage Build status NPM Version MIT License


Quick start

// snowpack.config.json
{
  "plugins": [["snowpack-plugin-svgr", { /* see "Plugin Options" below */ }]]
}

Plugin Options

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 `@svgr/core`'s `convert()` function
   * See: https://react-svgr.com/docs/options/
   */
  svgrOptions?: any
}

LICENSE

MIT