fix: don't bake demo-vault-v2 path into CI builds

When CI=true, skip injecting __DEMO_VAULT_PATH__ so the CI runner's
absolute path (/Users/runner/...) is never compiled into the bundle.
The default vault path is resolved at runtime via get_default_vault_path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-04-06 14:31:04 +02:00
parent 8bd26b5d26
commit e2890ecbb5

View File

@@ -414,11 +414,11 @@ export default defineConfig({
},
},
// Inject the demo-vault-v2 path in dev mode only — production Tauri builds must
// resolve the default vault path at runtime via the backend to avoid baking
// the CI runner's absolute path into the distributed bundle.
// Inject the demo-vault-v2 path in local dev only — production Tauri builds and
// CI must resolve the default vault path at runtime via the backend to avoid
// baking the CI runner's absolute path into the distributed bundle.
define: {
...(process.env.TAURI_PLATFORM && !process.env.TAURI_DEBUG
...(process.env.CI || (process.env.TAURI_PLATFORM && !process.env.TAURI_DEBUG)
? {}
: { __DEMO_VAULT_PATH__: JSON.stringify(path.resolve(__dirname, 'demo-vault-v2')) }),
},