Files
CA/frontend/vite.config.ts
Akiba So e22b004f9e feat: GeoScene frontend POC + Docker deploy for remote host
Migrate maps to @geoscene/core, polish monitoring/alerts UX, fix timeline
basemap flicker and district alert regions, and ship compose/nginx Docker
deploy assets with CBPOA_ROOT data mounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 03:28:29 +08:00

41 lines
1009 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
optimizeDeps: {
exclude: ['@geoscene/core'],
},
server: {
port: 3000,
allowedHosts: ['alpha.hyh.ink'],
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
// Same-origin Gaode tiles — WebTileLayer needs CORS; direct autonavi URLs fail.
'/basemap-gaode': {
target: 'https://webrd01.is.autonavi.com',
changeOrigin: true,
rewrite: (p) => {
const m = p.match(/^\/basemap-gaode\/(\d+)\/(\d+)\/(\d+)/);
if (!m) return p;
const [, z, x, y] = m;
return `/appmaptile?lang=zh_cn&size=1&scale=1&style=8&z=${z}&x=${x}&y=${y}`;
},
},
},
},
preview: {
port: 3000,
allowedHosts: ['alpha.hyh.ink'],
},
})