How to add Fontawesome 5 to Symfony 4 using Webpack Encore

后端 未结 7 1570
鱼传尺愫
鱼传尺愫 2020-12-29 04:34

I want to add Font Awesome 5 to my Symfony 4 project, this is what I did :

  • I added font awesome to my project using yarn : yarn add --dev @fortawesome/f
相关标签:
7条回答
  • 2020-12-29 05:27

    According font-awesome docs here, after install package

    yarn add --dev @fortawesome/fontawesome-free
    

    or

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

    Require font-awesome into your config file (in my case and default Symfony 4 location) assets/js/app.js:

    require('@fortawesome/fontawesome-free/css/all.min.css');
    require('@fortawesome/fontawesome-free/js/all.js');
    

    Compile again yarn encore dev and icons should appear.

    0 讨论(0)
提交回复
热议问题