For some reason, I always have trouble setting up Font Awesome (quickly) with Laravel & Elixir.
It’s three easy steps.
Pull in font-awesome with npm or yarn
1 2 3 4 5 |
# npm npm install font-awesome --save # yarn yarn add font-awesome |
Import Font Awesome’s stylesheets in your app.scss file
1 |
@import "node_modules/font-awesome/scss/font-awesome.scss"; |
Copy Font Awesome’s font files to your public directory
Configure Elixir to do this automatically for you in your gulpfile:
1 2 3 4 5 |
elixir((mix) => { mix.sass('app.scss') .webpack('app.js') .copy('node_modules/font-awesome/fonts/*.*', 'public/fonts/'); }); |
This last step is the one that I mix up, specifically the *.* .
Hopefully this will help someone like me!