Learn how OpenAPI can automate API client generation to save time, reduce bugs, and streamline how your frontend app talks to backend APIs.
Discover how the Interface Segregation Principle (ISP) keeps your code lean, modular, and maintainable using real-world analogies and practical examples.
<selectedcontent>
element improves dropdowns
is an experimental HTML element that gives developers control over how a selected option is displayed, using just HTML and CSS.
Learn how to implement an advanced caching layer in a Node.js app using Valkey, a high-performance, Redis-compatible in-memory datastore.
9 Replies to "Best practices for loading fonts in Vue"
Doesn’t work for me. Font files get hashed for me so the link src tags in index.html don’t match after webpack processes those files.
Your font files will get hashed if they are somewhere in the “src” folder. Put your fonts assets in the “public” folder as is in the tutorial and this should work.
Same. it LR does work with hashed files.
Your font files will get hashed if they are somewhere in the “src” folder. Put your fonts assets in the “public” folder as is in the tutorial and this should work.
I changed the “href” path to “../fonts/Roboto/Roboto-Regular.woff2”. Note double dots in front. Not sure, but I think it has to do something with how static / relative files are processed by WebPack.
Your font files will get hashed if they are somewhere in the “src” folder. Put your fonts assets in the “public” folder as is in the tutorial and this should work.
Doesn’t work for me too. Anybody had any solutions ?
Your font files will get hashed if they are somewhere in the “src” folder. Put your fonts assets in the “public” folder as is in the tutorial and this should work.
Build will fail cause webpack can not find relative file in public folder, ./fonts/Roboto-Regular.woff referred in CSS file, which is in src/assets/
Solution is to put fonts folder also into assets/ folder, and webpack build will work and font files ase copied into “public” or really dist/fonts on build. Also npm run serve will work too.