Install font awesome 5 with npm for scss usage

前端 未结 4 1655
既然无缘
既然无缘 2021-02-05 12:03

like title says, I can not install font awesome 5 with npm for scss purposes.

Trying to install version 5

Accoring to https://fontawesome.com/how-to-use/use-wi

4条回答
  •  甜味超标
    2021-02-05 12:15

    In case if you'd like to extract all the Font Awesome specific Javascript files to the vendor.js using Laravel Mix, you'll need to only extract the packages to the extract() method as an array. You won't even need to use the fontawesome.library.add() method to add support for the fonts. This will help you to manage the vendor specific file cache in future.

    mix.js('resources/assets/js/app.js', 'public/js')
        .extract([
            '@fortawesome/fontawesome',
            '@fortawesome/fontawesome-free-brands',
            '@fortawesome/fontawesome-free-regular',
            '@fortawesome/fontawesome-free-solid',
            '@fortawesome/fontawesome-free-webfonts'
        ]);
    

提交回复
热议问题