Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Swaz's avatar
Level 20

Why does 'vite build' re-hash unchanged files

I have a large app with hundreds of vue pages and components. When I run vite build, it generates a file for each of those components (as expected).

//...
public/build/assets/Index-fc29225d.js      1.13 kB  | 0.60 kB 
public/build/assets/Show-b2d590a1.js       1.13 kB  | 0.63 kB 
//...

However, when I make a single change to a single component, then runvite build, it regenerates every single file with a new hash appended.

//...
public/build/assets/Index-a1503afe.js      1.13 kB  | 0.60 kB 
public/build/assets/Show-91fa0c7f.js       1.13 kB  | 0.63 kB 
//...

I thought the entire point of splitting the files like this, is so that the browser could cache the unchanged files. Is there a setting for this? Am I missing something?

0 likes
1 reply
gilbitron's avatar

I have the same problem at the moment. It's especially annoying when you have a large codebase hosted using Laravel Vapor, as Vapor takes ages to offload all of the changed assets for every deployment.

Please or to participate in this conversation.