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.
Apr 11, 2023
1
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?
Please or to participate in this conversation.