fix: ensure vite build watch mode works - #16632
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/849b73d34eb9cb2fa0e154230be03e606b9ea6f8Open in |
🦋 Changeset detectedLatest commit: 849b73d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
vite build --watch49a9699 to
96fe7e0
Compare
|
What if the replacement happened in generateBundle instead, mutating chunk.code before write? That would make rebuilds correct by construction and remove normalise_build entirely. As it stands the chunk threading also still crashes; the second argument is evaluated before the watcher's first build, so it's permanently undefined (repro'd with the pkg build from 49a9699 on vite 8.0.12 and 8.2.0, same "chunks is not iterable" as #16624; the ERROR path has the same issue). |
e99e640 to
849b73d
Compare
|
The real issue is that all our logic in the |
fixes #16624
Two changes were required:
builder.buildwhich can return a watcher instead of the build chunks. Added a normaliser to handle that. Unfortunately, the bundle has to be taken from thegenerateBundlehook.Questions:
build --watchprocess and end it if the assertions pass? with a timeout so it doesn't go on indefinitely?