How to make Font awesome 5 work with webpack

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

    Incase anyone comes looking for a solution for implementing font awesome 5 (fa5) in symfony 4+ applications using webpack, the solution is the same as others have mentioned previously.

    So firstly you will have to install fontawesome. Run yarn add @fortawesome/fontawesome-free on your terminal.

    Then you simply require all.css and all.js in your app.js file. Incase it's not clear which app.js file I'm referring to here, you can find the app.js file in the app-root/assets/js directory.

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

    import '@fortawesome/fontawesome-free/css/all.css';

提交回复
热议问题