What is the best way to import a font, ttf
, without webpack
?
I am using react-pdf
to generate a file. With vite
I am able to display it in browser but I would like to add a cli command to be able to generate it quickly. Using babel
with babel-node
I’m able to reuse most of the code but the font imports are failing with unexpected format errors.
import Roboto from ‘./fonts/Roboto-Regular.ttf’;
Is there a file loader I can add to handle this type of import so the code is still shareable between vite
and my cli command.