Observe how the pink text "Font rendering difference" is rendered in the running Vite dev server
pnpm run build, pnpm run preview
Observe how the pink text "Font rendering difference" is rendered in the built files
What is expected?
The font should render identically in both environments — live preview via the Vite dev server and the built HTML
What is actually happening?
The font renders thinner in the Vite dev server compared to the built HTML (or the other way around - font rendered thicker in the built HTML compared to the Vite dev server)
The issue arises in the default Vue HelloWorld template with all styles and settings being default. Only a single line of HTML and one CSS rule were added to demonstrate the issue.
I first encountered this while setting up Tailwind CSS in a freshly created Vue HelloWorld app. Later, I reproduced the issue without Tailwind or any other modifications — only the default Vue HelloWorld setup was used.
Vue version
3.5.12
Link to minimal reproduction
https://github.com/alexchexes/vue-built-font-rendering-difference
Steps to reproduce
pnpm install
,pnpm run dev
pnpm run build
,pnpm run preview
What is expected?
The font should render identically in both environments — live preview via the Vite dev server and the built HTML
What is actually happening?
The font renders thinner in the Vite dev server compared to the built HTML (or the other way around - font rendered thicker in the built HTML compared to the Vite dev server)
System Info
Any additional comments?
The issue arises in the default Vue HelloWorld template with all styles and settings being default. Only a single line of HTML and one CSS rule were added to demonstrate the issue.
I first encountered this while setting up Tailwind CSS in a freshly created Vue HelloWorld app. Later, I reproduced the issue without Tailwind or any other modifications — only the default Vue HelloWorld setup was used.
Here is a screencast demonstration:
https://github.com/user-attachments/assets/26361b69-5bdb-4e24-9ff2-6a9cbcc50aba
Vite dev server:
Build:
Computed styles are identical in both cases: