AlexanderKim
440
13
Mix

Fontawesome 5 with npm

Posted 9 months ago by AlexanderKim

I've installed fontawesome with npm:

npm i --save @fortawesome/fontawesome

Now directory @fortawesome appeared under node_modules, but how exactly to use it?

Documentation says:

import fontawesome from '@fortawesome/fontawesome'
import faUser from '@fortawesome/fontawesome-free-solid/faUser'
import faCircle from '@fortawesome/fontawesome-free-regular/faCircle'
import faFacebook from '@fortawesome/fontawesome-free-brands/faFacebook'

fontawesome.library.add(faUser)
fontawesome.library.add(faCircle)
fontawesome.library.add(faFacebook)

But where to place it? I want to use fontawesome 5 locally without any CDN's.

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.