How to make Font awesome 5 work with webpack

前端 未结 7 1637
野性不改
野性不改 2021-01-30 16:33

I\'m trying to use Fontawesome in my Flask/webpack project.

The craziest thing is some point it worked then stopped, I changed something stupid, it worked again and fina

7条回答
  •  星月不相逢
    2021-01-30 17:29

    Just import this file in your myStyle.js

    import '@fortawesome/fontawesome-free/js/all'
    

    or you can import only specific size of icons

    import '@fortawesome/fontawesome-free/js/light'
    import '@fortawesome/fontawesome-free/js/regular'
    import '@fortawesome/fontawesome-free/js/solid'
    import '@fortawesome/fontawesome-free/js/brands'
    

    I think fontawesome.library.add() is not needed.

提交回复
热议问题