2

Tried different ways to load the custom Gugi/Roboto font in webpack 4. None seems to load the font properly.

But, when I install the font in system, it works as expected - indicating that Css and app works fine. Thus, it seems to be a webpack problem which I can't figure.

index.js

import 'typeface-roboto';

Webpack config

{ test: /\.jsx?$/, use: 'babel-loader', exclude: /node_modules/ },
{ test: /\.css$/, loader: 'css-loader' },
{ test: /\.woff2?$/, loader: 'url-loader?limit=100000&mimetype=application/font-woff' },

I am using mui-next in React which should work out of box with Roboto fonts. ( The font works perfect if it is available in the system - Install in windows or so.)

Additionally, tried different methods - loading font through font.css with woff2 files copied through gulp. Strange - none of the options seems to work.

Thanks for any help!

user3499836
  • 87
  • 1
  • 9

0 Answers0