Gate /social/work behind join/login/profile; harden Work UX and LanguageSwitcher SSR; deploy portal, admin, and work API. Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
||
import react from '@vitejs/plugin-react'
|
||
|
||
/**
|
||
* admin.nomadro.com — Web only; isolated from apps/admin (.cn)
|
||
* 本地默认打本机 API(与门户共用 data/remote-config.json),改价即时生效。
|
||
* 连美国机:VITE_DEV_API=https://api.nomadro.com
|
||
*/
|
||
const DEV_API = process.env.VITE_DEV_API || 'http://127.0.0.1:8080'
|
||
|
||
export default defineConfig({
|
||
plugins: [react()],
|
||
server: {
|
||
port: 5174,
|
||
proxy: {
|
||
'/api': {
|
||
target: DEV_API,
|
||
changeOrigin: true,
|
||
secure: true,
|
||
},
|
||
'/health': {
|
||
target: DEV_API,
|
||
changeOrigin: true,
|
||
secure: true,
|
||
},
|
||
},
|
||
},
|
||
build: {
|
||
outDir: 'dist',
|
||
target: 'es2020',
|
||
cssCodeSplit: true,
|
||
modulePreload: { polyfill: true },
|
||
reportCompressedSize: false,
|
||
rollupOptions: {
|
||
output: {
|
||
manualChunks(id) {
|
||
if (!id.includes('node_modules')) return
|
||
if (id.includes('react-router')) return 'router'
|
||
if (id.includes('react-dom') || id.includes('/react/')) return 'react'
|
||
},
|
||
},
|
||
},
|
||
},
|
||
optimizeDeps: {
|
||
include: ['react', 'react-dom', 'react-router-dom'],
|
||
},
|
||
})
|