Commit 78d6dcb
committed
fix(bundler): copy the vite bundle to native in non-watch builds
The Vite bundler integration copies its output (`.ns-vite-build/`) into the
native project's `assets/app` only from the watch-mode IPC handler in
`compileWithWatch` (the `emittedFiles` message). A non-watch build —
`ns build`, or `ns run --justlaunch` — runs `compileWithoutWatch`, which has
no IPC channel (`startBundleProcess` sets `stdio: "inherit"` when
`prepareData.watch` is false) and never calls `copyViteBundleToNative`. The
Vite output is therefore left in `.ns-vite-build/`, `assets/app` stays empty,
and the Static Binding Generator fails with "Couldn't find sbg-bindings.txt"
(no JS input). Webpack/rspack are unaffected — they write directly into the
platform folder.
Copy the full Vite bundle in `compileWithoutWatch`'s `close` handler on a
successful (exit code 0) build, mirroring the full-build branch of the
watch-mode copy.1 parent 69ac96d commit 78d6dcb
1 file changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
383 | 402 | | |
384 | 403 | | |
385 | 404 | | |
| |||
0 commit comments