This plugin allow you to use svgr as loader for svg images together with default file-loader
$ yarn add docz-plugin-svgr
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>
)
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 })]
}