|
| 1 | +import { |
| 2 | + defineConfig, |
| 3 | + overrideDefineForWebAppServe, |
| 4 | + Schema, |
| 5 | +} from '@julr/vite-plugin-validate-env'; |
| 6 | + |
| 7 | +const webAppServeEnabled = process.env.WEB_APP_SERVE_ENABLED?.toLowerCase() === 'true'; |
| 8 | +if (webAppServeEnabled) { |
| 9 | + // eslint-disable-next-line no-console |
| 10 | + console.warn('Building application for web-app-serve'); |
| 11 | +} |
| 12 | +const overrideDefine = webAppServeEnabled |
| 13 | + ? overrideDefineForWebAppServe |
| 14 | + : undefined; |
| 15 | + |
| 16 | +export default defineConfig({ |
| 17 | + overrideDefine, |
| 18 | + validator: 'builtin', |
| 19 | + schema: { |
| 20 | + // NOTE: These are the dynamic env variables |
| 21 | + VITE_FIREBASE_API_KEY: Schema.string.optional(), |
| 22 | + VITE_FIREBASE_AUTH_DOMAIN: Schema.string.optional(), |
| 23 | + VITE_FIREBASE_DATABASE_URL: Schema.string.optional(), |
| 24 | + VITE_FIREBASE_PROJECT_ID: Schema.string.optional(), |
| 25 | + VITE_FIREBASE_STORAGE_BUCKET: Schema.string.optional(), |
| 26 | + VITE_FIREBASE_MESSAGING_SENDER_ID: Schema.string.optional(), |
| 27 | + VITE_FIREBASE_APP_ID: Schema.string.optional(), |
| 28 | + VITE_FIREBASE_MEASUREMENT_ID: Schema.string.optional(), |
| 29 | + |
| 30 | + VITE_BASE_URL: Schema.string.optional(), |
| 31 | + VITE_PRIVACY_POLICY_URL: Schema.string.optional(), |
| 32 | + VITE_IMPRINT_URL: Schema.string.optional(), |
| 33 | + VITE_APP_LOGO: Schema.string.optional(), |
| 34 | + VITE_PROJECTS_FALLBACK_IMAGE: Schema.string.optional(), |
| 35 | + VITE_ALLOW_UNVERIFIED_USERS: Schema.string.optional(), |
| 36 | + |
| 37 | + VITE_DEFAULT_LOCALE: Schema.string.optional(), |
| 38 | + VITE_FALLBACK_LOCALE: Schema.string.optional(), |
| 39 | + VITE_SUPPORTED_LOCALES: Schema.string.optional(), |
| 40 | + |
| 41 | + VITE_THEME_LIGHT_PRIMARY: Schema.string.optional(), |
| 42 | + VITE_THEME_LIGHT_SECONDARY: Schema.string.optional(), |
| 43 | + VITE_THEME_LIGHT_TERTIARY: Schema.string.optional(), |
| 44 | + VITE_THEME_LIGHT_ACCENT: Schema.string.optional(), |
| 45 | + VITE_THEME_LIGHT_ERROR: Schema.string.optional(), |
| 46 | + VITE_THEME_LIGHT_WARNING: Schema.string.optional(), |
| 47 | + VITE_THEME_LIGHT_INFO: Schema.string.optional(), |
| 48 | + VITE_THEME_LIGHT_SUCCESS: Schema.string.optional(), |
| 49 | + VITE_THEME_LIGHT_NEUTRAL: Schema.string.optional(), |
| 50 | + |
| 51 | + VITE_APP_NAME: Schema.string.optional(), |
| 52 | + VITE_APP_WEBSITE_URL: Schema.string.optional(), |
| 53 | + VITE_APP_ATTRIBUTION_TITLE: Schema.string.optional(), |
| 54 | + VITE_APP_ATTRIBUTION_URL: Schema.string.optional(), |
| 55 | + |
| 56 | + VITE_COMMUNITY_DASHBOARD_URL: Schema.string.optional(), |
| 57 | + |
| 58 | + VITE_MAPILLARY_API_KEY: Schema.string.optional(), |
| 59 | + |
| 60 | + VITE_OSM_OAUTH_REDIRECT_URI: Schema.string.optional(), |
| 61 | + }, |
| 62 | +}); |
0 commit comments