Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: speed up build by ensuring stable cache (sveltejs#569)
Our builds got slower because the cache hash was always different. This happened because the dependencies were calculated based on the generated code after Vite compiled it, i.e. it would check stuff in .svelte-kit/output/server/chunks/...js. This seems to have worked fine for a while, but now Vite mashes things up such that code from svelte.dev/src/lib/server/content.ts is mixed in, which has loads of Vite hashes in it, and so the file content is always different. That in turn means our hash is always different, and so the snippet cache never hits. The pragmatic solution is to hard-code the path to the original file and add a sanity check to ensure it's still accurate. related to sveltejs#307
- Loading branch information