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:
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=YOUR-TOKEN
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
Related Posts
- Add New Project To Laravel Homestead
- Install Laravel in Cloud9 PHP Workspace
- Add Bulma to Laravel
- Install Umami Analytics with Let's Encrypt HTTPS
- Fix "No Xcode or CLT version detected" When Running npm install
- Add a self hosted alpine.js file with Laravel
- Fix "419 Sorry, your session has expired" After Renaming a Laravel Project
- Add self hosted Google Fonts to your Laravel App