Files
nl-tcm-agent-admin/vite.config.js
2026-08-15 12:52:39 +08:00

40 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from "@tailwindcss/vite"
import path from 'path'
// TCM Agent 管理前端构建配置
// - base 固定 /admin/Go 端把 SPA 挂在 /admin 路径下router.go 的 NoRoute 回退)
// - outDir 直接输出到 Go 项目的 view/admin-dist单二进制 + 静态目录部署,无需拷贝
// - 开发代理指向本机 Go 服务 18123不 rewriteGo 的路由本身就带 /api 前缀)
export default defineConfig({
base: '/admin/',
plugins: [
vue(),
tailwindcss()
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
build: {
outDir: path.resolve(__dirname, '../nl-tcm-agent/view/admin-dist'),
emptyOutDir: true,
chunkSizeWarningLimit: 1500
},
server: {
port: 8890,
proxy: {
'/api': {
target: 'http://127.0.0.1:18123',
changeOrigin: true
},
'/health': {
target: 'http://127.0.0.1:18123',
changeOrigin: true
}
}
}
})