Support build-time ditto.json config file
Read an optional ditto.json (or CONFIG_FILE env) at build time, validate it with Zod, and inject the result via Vite's define. At runtime the build-time values are merged between the hardcoded defaults and user localStorage, giving precedence: user > build-time > hardcoded. Extract canonical Zod schemas into config/schema.ts (no path aliases) so they can be imported from both vite.config.ts and runtime code. Move AppConfigSchema out of AppProvider into src/lib/schemas.ts to eliminate duplication.
This commit is contained in:
@@ -33,6 +33,9 @@ deploy.sh
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Build-time configuration
|
||||
ditto.json
|
||||
|
||||
# Android build outputs and sensitive files
|
||||
*.aab
|
||||
resources/
|
||||
|
||||
Reference in New Issue
Block a user