How to include Roboto font in webpack build for Material UI?

后端 未结 5 558
眼角桃花
眼角桃花 2021-01-30 03:45

For a progressive web app based on Material UI (React) and built with Webpack, how do I properly include Roboto font(s) so that the app does not depend

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 04:38

    You can also do it like it is documented in this issue: https://github.com/callemall/material-ui/issues/6256

    npm install typeface-roboto --save
    

    Then, in your index.js:

    import 'typeface-roboto'
    

    Works with webpack/create-react-app.

提交回复
热议问题