Hi,
Because the current implementation use fs, I cannot use simple-icons in a browser without passing through a CDN.
How about introducing webpack in this project to be able to build a static index.js with all svg strings already injected in the bundle ?
https://github.com/webpack-contrib/svg-inline-loader
A similar issue is described in #751.
This is definitely one of the things we need to fix, in addition to making the package tree shakeable. It would probably happen by compiling the icons into static JSON files before pushing to NPM (relevant #898) - although other solutions are most welcome.
We just haven't gotten around to doing it; if anyone feels like submitting a PR, that would be appreciated :smile:
Until then, try using import icon from "simple-icons/icons/googleplus.svg" (or whichever icon it is you want)
Most helpful comment
A similar issue is described in #751.
This is definitely one of the things we need to fix, in addition to making the package tree shakeable. It would probably happen by compiling the icons into static JSON files before pushing to NPM (relevant #898) - although other solutions are most welcome.
We just haven't gotten around to doing it; if anyone feels like submitting a PR, that would be appreciated :smile:
Until then, try using
import icon from "simple-icons/icons/googleplus.svg"(or whichever icon it is you want)