Fix admin SQL count parsing for local SpacetimeDB
This commit is contained in:
43
apps/admin-web/vite.config.ts
Normal file
43
apps/admin-web/vite.config.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import {dirname, resolve} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
|
||||
import react from '@vitejs/plugin-react';
|
||||
import {defineConfig, loadEnv} from 'vite';
|
||||
|
||||
const adminWebRoot = dirname(fileURLToPath(import.meta.url));
|
||||
const repoRoot = resolve(adminWebRoot, '../..');
|
||||
|
||||
export default defineConfig(({mode}) => {
|
||||
const repoEnv = loadEnv(mode, repoRoot, '');
|
||||
const appEnv = loadEnv(mode, adminWebRoot, '');
|
||||
const env = {...repoEnv, ...appEnv};
|
||||
const apiTarget =
|
||||
env.ADMIN_API_TARGET ||
|
||||
env.GENARRATIVE_API_TARGET ||
|
||||
`http://127.0.0.1:${env.GENARRATIVE_API_PORT || '3100'}`;
|
||||
|
||||
return {
|
||||
root: adminWebRoot,
|
||||
envDir: repoRoot,
|
||||
plugins: [react()],
|
||||
server: {
|
||||
proxy: {
|
||||
'/admin/api': {
|
||||
target: apiTarget,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
'/healthz': {
|
||||
target: apiTarget,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
chunkSizeWarningLimit: 600,
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user