I am brand new to Angular. I have finished the tutorial and am now building my first app.
Adding an OTF file works fine, but when I made a change to my app.component.css and added:
@font-face { font-family: bookman; src: url('../../../BOOKOS.TTF'); }
When I add this line, I get the following error in my browser:
Failed to compile.
../BOOKOS.TTF
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
@ ./src/app/app.component.css 7:186-216
@ ./src/app/app.component.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
I did some research and found a couple of pages like:
Why does module parse failed: /xxx/MyFont.ttf Unexpected character ''
And they suggest adding this:
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
}
to my webpack config rules array.
The problem is that I have no idea what that is. It looks like that webpack may be a JS library that Angular is using under the covers, but I don't have any configuration files for webpack in my directory structure.