Laravel asset compilation for Laravel 9 + Laravel Mix 6 + Font Awesome 6

Steps

node -v
npm -v
npm install -D laravel-mix@latest postcss@latest autoprefixer@latest
npm install -D @fortawesome/fontawesome-free
const mix = require('laravel-mix');mix.setPublicPath('public');
mix.setResourceRoot('../');
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css', [
]);
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.0.0",
@import '~@fortawesome/fontawesome-free/css/fontawesome';
@import '~@fortawesome/fontawesome-free/css/regular';
@import '~@fortawesome/fontawesome-free/css/solid';
@import '~@fortawesome/fontawesome-free/css/brands';
npx mix -p
npm run prod
<link type="text/css" rel="stylesheet" href="{{ mix('css/app.css') }}">

--

--

--

Full Stack Engineer at NASA. Volunteer at Smithsonian’s The Renwick Gallery, and former drummer of #GovernmentIssue. https://www.karlhill.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Angular 4 year road map

Reusable Component For Responsive Grid Of Cards In Quasar Using Colcade

Angular vs. React: Which one is the preferred framework in 2021?

Build a Simple Login System — React — Frontend

Cabin tilt cylinder assembly

MASAI Journey

Understanding TypeScript

Easy peasy GraphQL authentication and authorization using Schema Directives

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Karl Hill

Karl Hill

Full Stack Engineer at NASA. Volunteer at Smithsonian’s The Renwick Gallery, and former drummer of #GovernmentIssue. https://www.karlhill.com

More from Medium

Image Upload In Laravel

Minimum Hosting Specification for Laravel ( or Laravel Lumen)?

Annotations, Unions, and Aliases in TypeScript

Multiple Laravel DataTables in one view — as a Service Implementation