Simple-icons: Make simple-icons npm package compatible with browsers

Created on 23 Aug 2018  路  1Comment  路  Source: simple-icons/simple-icons

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

meta

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)

>All comments

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)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aempha picture aempha  路  3Comments

gauravghongde picture gauravghongde  路  3Comments

foo-dogsquared picture foo-dogsquared  路  3Comments

MaxWinterstein picture MaxWinterstein  路  3Comments

schifferl picture schifferl  路  3Comments