Add Fontawesome Pro to Your Laravel Project Using Npm

If you want to add Fontawesome 5 Pro to your Laravel project using npm, first create a file .npmrc in your project root. Content of this file should be:


Make sure to replace YOUR-TOKEN by your personal Fontawesome 5 Pro token.

Then, run:

npm install --save-dev @fortawesome/fontawesome-pro

Add the following lines to your resources/assets/sass/app.scss (or skip not wanted types):

@import "node_modules/\@fortawesome/fontawesome-pro/scss/fontawesome.scss";
@import "node_modules/\@fortawesome/fontawesome-pro/scss/light.scss";
@import "node_modules/\@fortawesome/fontawesome-pro/scss/regular.scss";
@import "node_modules/\@fortawesome/fontawesome-pro/scss/solid.scss";

Now, in development mode run:

npm run dev

Or in production mode, run:

npm run production