Skip to content

Commit 8aad4ea

Browse files
committed
feat(vite): run HMR sessions on vite serve alone when the package supports it
When the installed @nativescript/vite lists the platform under `nativescriptCli.singleProcessDev` in its package.json, the CLI spawns only `vite serve` with NS_VITE_SINGLE_PROCESS=1. The server writes bundle.mjs, package.json and the app's static files into the staging directory and sends the build messages `vite build --watch` sends today; the CLI copies and syncs on them as before and launches the app on the first. Packages without the field keep the two-process session, and NS_VITE_SINGLE_PROCESS=0 in the CLI's environment opts out. A build message may now carry `removedFiles`, which the CLI deletes from the native app folder. The serve process is tracked as the platform's bundler process, a serve exit before its first message fails the run, and stopping the session terminates it once.
1 parent 437a3bc commit 8aad4ea

3 files changed

Lines changed: 564 additions & 134 deletions

File tree

0 commit comments

Comments
 (0)