I keep getting a weird error on fontawesome fonts. First here are the steps that I took to insert the fonts:
npm install font-awesome
. This created a font-awesome directory innode_modules
In my sass file (located in src/styles), I imported fontawesome using:
@import '../../node_modules/font-awesome/scss/font-awesome';
I copied the fonts from
node_modules/font-awesome/fonts
intosrc/fonts
Here is my react application directory structure:
/src
/actions
/reducers
/components
/fonts (fontawesome fonts are here)
/styles
/app.scss (font awesome imported here)
/index.html
/index.jsx
/test
/node_modules
/webpack.config.js
The error I get are the following (copied from browser console):
Failed to load resource: http://localhost:9090/c8ddf1e5e5bf3682bc7bebf30f394148.woff Failed to load resource: http://localhost:9090/1dc35d25e61d819a9c357074014867ab.ttf Failed to load resource: http://localhost:9090/d7c639084f684d66a1bc66855d193ed8.svg#fontawesomeregular
What am I doing wrong? $fa-font-path
by default equals to ../fonts
.
EDIT: Here is my webpack config for fonts:
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "url-loader?limit=10000&mimetype=application/font-woff"
},
{
test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loader: "file-loader"
},