This package has been deprecated

Author message:

The svgr support now is built-in on docz-core

docz-plugin-svgr
TypeScript icon, indicating that this package has built-in type declarations

0.11.0 • Public • Published

docz-plugin-svgr

This plugin allow you to use svgr as loader for svg images together with default file-loader

Install

$ yarn add docz-plugin-svgr

Usage

Just import the plugin and add it on your doczrc.js

import { svgr } from 'docz-plugin-svgr'

export default {
  plugins: [svgr()]
}

Then just use named imports to import using svgr

import starUrl, { ReactComponent as Star } from './star.svg'

const App = () => (
  <div>
    <img src={starUrl} alt="star" />
    <Star />
  </div>
)

Custom options

If you want to pass custom options for @svgr/webpack just pass as first argument of the functio

import { svgr } from 'docz-plugin-svgr'

export default {
  plugins: [svgr({ native: true })]
}

Readme

Keywords

none

Package Sidebar

Install

npm i docz-plugin-svgr

Weekly Downloads

3

Version

0.11.0

License

MIT

Unpacked Size

7.11 kB

Total Files

11

Last publish

Collaborators

  • pedronauck