fix: web-app config.ts fails when deployments-local.json is absent

Use brace expansion in import.meta.glob pattern so Vite treats it as a
dynamic glob (returns {} when no files match) instead of compiling it
to a static import that errors when the gitignored file is absent in CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-20 10:45:13 +00:00
parent 282ac72c14
commit cee79eedb3

View file

@ -19,8 +19,10 @@ interface DeploymentsLocal {
infrastructure?: DeploymentInfrastructure; infrastructure?: DeploymentInfrastructure;
} }
// deployments-local.json is gitignored (local dev only); fall back to empty if absent (CI, production) // deployments-local.json is gitignored (generated per-run by bootstrap scripts).
const _localFiles = import.meta.glob<DeploymentsLocal>('../../onchain/deployments-local.json', { // Use a glob pattern (brace expansion) so Vite treats it as dynamic — returns {}
// when the file is absent (CI, production) instead of a hard import error.
const _localFiles = import.meta.glob<DeploymentsLocal>('../../onchain/deployments-local{.json}', {
eager: true, eager: true,
import: 'default', import: 'default',
}); });