fix: copy Vite output for production builds#6083
Conversation
📝 WalkthroughWalkthroughVite build paths are centralized, native output copying now supports fail-fast behavior, and non-watch compilation copies successful Vite builds before resolving. Tests cover successful copying and propagation of copy failures. ChangesVite bundle copy reliability
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks @tannerlinsley we have a lot of Vite improvements targeting 9.1 - this case is handled here: You can use this (which includes 6010) now, with |
|
Ignore the merge conflicts, I'll handle those later today or tomorrow 👍 |
119042b
into
NativeScript:feat/vite-bundler-improvements
…n-bundle fix: copy Vite output for production builds Resolved conflicts with this branch's existing non-watch Vite copy step by combining both implementations: - kept #6083's strict semantics: copyViteBundleToNative gains a failOnError flag, compileWithoutWatch passes true and rejects when a successful build's bundle cannot be copied, and the Vite output directory is validated before the destination is cleaned so a missing build can no longer wipe a previously good bundle - kept this branch's NS_VITE_DIST_DIR-aware output path resolution: #6083's getViteBuildPaths() helper now delegates to getViteDistOutputPath() instead of hardcoding .ns-vite-build - adapted #6083's compileWithoutWatch copy tests to this branch's test conventions (getBundler stub, per-test hostProjectModuleName, NS_VITE_DIST_DIR save/restore guard) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Problem
Vite writes non-watch builds to
.ns-vite-build, but the CLI only copied that output into the native app directory from the watch-mode IPC handler.ns build iosandns build androidcould therefore package stale or missing JavaScript.Fix
Validation
npm test(1509 passing, 9 pending).appbundle.apkbundleSummary by CodeRabbit
Bug Fixes
Tests