I have a local RobotoFont.tff which I am referencing in my index.scss file like this:
@font-face {
font-family: 'Roboto';
src: url('src/assets/Roboto/Roboto-Regular.ttf') format('truetype');
}
.rb {font-family: 'Roboto';}
But I am getting the following error at compile time:
Failed to compile.
./src/assets/Roboto/Roboto-Regular.ttf 1:0
Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
The project is in React-Typescript and do I need to install any specific loaders as specified in the link? If yes does it work for .ttf files?