mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
Test development and built-preview route registration, preserve development-only credential editing, and document local preview configuration.
23 lines
892 B
JavaScript
23 lines
892 B
JavaScript
import { fileURLToPath } from 'node:url';
|
|
import { defineConfig, loadEnv } from 'vite';
|
|
import { createBrowserViteConfig } from '../../build/vite.js';
|
|
import { localProviderPlugins } from '../providers/local.js';
|
|
import { apiNotFoundPlugin } from './api-not-found.js';
|
|
|
|
const root = fileURLToPath(new URL('../../', import.meta.url));
|
|
|
|
/** Load this checkout's configuration and attach its local provider middleware. */
|
|
export default defineConfig(({ mode }) => {
|
|
const loaded = loadEnv(mode, root, '');
|
|
for (const [key, value] of Object.entries(loaded)) {
|
|
if (process.env[key] === undefined) process.env[key] = value;
|
|
}
|
|
return createBrowserViteConfig({
|
|
plugins: [...localProviderPlugins(), apiNotFoundPlugin()],
|
|
googleApiKey: process.env.GOOGLE_MAPS_API_KEY,
|
|
cesiumToken: process.env.CESIUM_ION_TOKEN,
|
|
host: process.env.HOST,
|
|
port: process.env.PORT,
|
|
});
|
|
});
|