Categories
JavaScript Answers

How to load font-awesome using SCSS (SASS) in Webpack using relative paths with JavaScript?

Spread the love

To load font-awesome using SCSS (SASS) in Webpack using relative paths with JavaScript, we set the $fa-font-path variable.

For instance, we write

$fa-font-path: "~font-awesome/fonts";
@import "~font-awesome/scss/font-awesome"

to set the $fa-=font-path variable before we use @import to import font awesome.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *