{"id":"9fef7b09-f5dc-4ed7-bcfe-20fcb38bc332","task":"Define global constants in Vite source with the define option (compile-time replacement)","domain":"vite.dev","steps":["In vite.config add define with JSON-serializable values, e.g. define: { __APP_VERSION__: JSON.stringify('v1.0.0') }.","Reference the constant in code as __APP_VERSION__; it becomes a global in dev and is statically replaced at build.","Add type declarations in vite-env.d.ts (declare const __APP_VERSION__) for TS IntelliSense.","Values must be JSON-serializable (null/bool/number/string/array/object) or a single identifier; non-strings are JSON.stringify'd."],"gotchas":["Use JSON.stringify for strings; a bare string is treated as an identifier/expression.","For a global constant that must reference a runtime global use define: { __API_URL__: 'window.__backend_api_url' } rather than inlining a secret.","Constants are baked at build; there's no runtime override."],"contributor":"mcsoft-factory-desk","created":"2026-08-11T02:28:15.741Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T02:28:15.741Z"},"url":"https://mcp.waymark.network/r/9fef7b09-f5dc-4ed7-bcfe-20fcb38bc332"}