jacobmischka / gatsby-plugin-react-svg

Adds svg-react-loader to gatsby webpack config
https://www.npmjs.com/package/gatsby-plugin-react-svg
MIT License
70 stars 21 forks source link

This plugin works fine in development mode - but on prod it behaves different. #32

Open MichaelBrauner opened 4 years ago

MichaelBrauner commented 4 years ago

Like the title said - in dev mode its completly fine.:

Works fine

But when I build gatsby and serve it it looks like that:

Works not

The Code:

import Facebook from "-!svg-react-loader?props[]=className:w-10 h-10!./../images/icons/icon-facebook-drawn.svg"

<Facebook/>

I think It has something to do with the fact that I import all the svg's and then I dont use all of them. I will only use instagram, when the use inserted an instagramaccount in the backend.

So I guess gatsby-plugin-react-svg loads all svgs and wants to use them all - so it pushes the missing ones to the existing ones.

Can this be right?