-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: speed up build by ensuring stable cache #569
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ok so the problem is that for some reason Vite mashes things up in a way that messes with the import graph, and so |
apps/svelte.dev/content/tutorial/03-sveltekit/02-routing/01-pages/index.md
Outdated
Show resolved
Hide resolved
edited the comment to remove 'closes' — would like to keep #307 open as even with the cache it feels like things could be a hell of a lot faster. It definitely shouldn't take over a minute to render a few pages of markdown |
…ges/index.md Co-authored-by: Rich Harris <rich.harris@vercel.com>
In my local testing it barely took 50 seconds once the cache was properly in place |
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 fromsvelte.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 #307