These are the docs for
v1.x.x
. The docs forv0.x.x
are here
$ npm install gatsby-plugin-svgr
or
$ yarn add gatsby-plugin-svgr
module.exports = {
plugins: [
{
resolve: 'gatsby-plugin-svgr',
options: {
icon: true,
viewBox: false,
// see https://github.com/smooth-code/svgr for a list of all options
},
},
],
}
import starUrl, { ReactComponent as Star } from './star.svg'
const App = () => (
<div>
<img src={starUrl} alt="star" />
<Star />
</div>
)