0

I'm using several icon fonts into my project:

  1. font-awesome
  2. devicons
  3. simple-line-icons

However, I don't quite figure out how to load or make available these ones into my SPA web using webpack. Obviously, they are installed using npm...

What do I need to do in order to load them into my SPA page?

Any ideas?

Jordi
  • 20,868
  • 39
  • 149
  • 333

1 Answers1

0

You will likely need to use the font-awesome-sass-loader. This will need to be added to the webpack.config.js The css can then be imported into the area they are needed.

https://www.npmjs.com/package/font-awesome-sass-loader

Hope this helps, webpack can be difficult.

jbuchan12
  • 36
  • 1
  • 3
  • What about `devicons`, `simple-line-icons` and other ones? – Jordi Jan 18 '18 at 21:55
  • If they are SVG or PNG files then they can be added to a Sass file. http://sass-lang.com/ Then you can use the Sass loader from npm in the webpack config. This will then generate css files at runtime which can access icons. You then only need to import the css files. – jbuchan12 Jan 18 '18 at 22:07