I'm using create-react-app and I'm trying to integrate font-awesome so I can use it in my SPA.
I've done npm install font-awesome
and it's installed, but when I try to call import 'font-awesome/css/font-awesome.css'
I get the following error:
Compiling...
Failed to compile.
Error in ./~/font-awesome/css/font-awesome.css
Module parse failed: C:\Projects\myproject\ui\node_modules\font-awesome\css\font-awesome.css Unexpected character '@' (7:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected character '@' (7:0)
@ ./src/index.js 11:0-44
This is webpack related...
Webpack needs to use loader to read and parse different import statements...
CSS loader https://github.com/webpack-contrib/css-loader
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With