How to make Font awesome 5 work with webpack

前端 未结 7 1623
野性不改
野性不改 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:36

    this worked for me

    import "@fortawesome/fontawesome-free/js/all.js";
    import "@fortawesome/fontawesome-free/css/all.css";
    

    in: app/javascript/packs/application.js

    my case: Rails 6 webpacker gem, webpack, yarn

    installed via yarn add @fortawesome/fontawesome-free

    from https://github.com/rails/webpacker/issues/619#issuecomment-590454028

提交回复
热议问题