2026-08-28 15:06:01 +08:00
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
|
|
|
|
|
|
|
// 构建产物直接写入 Go 嵌入静态目录(main.go go:embed public)
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
|
plugins: [vue()],
|
|
|
|
|
|
base: './',
|
|
|
|
|
|
build: {
|
|
|
|
|
|
outDir: '../public',
|
2026-09-02 08:21:11 +08:00
|
|
|
|
emptyOutDir: false
|
2026-08-28 15:06:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
server: {
|
|
|
|
|
|
port: 7070,
|
|
|
|
|
|
host: true,
|
|
|
|
|
|
proxy: {
|
|
|
|
|
|
'/api': {
|
|
|
|
|
|
target: 'http://localhost:8888',
|
|
|
|
|
|
changeOrigin: true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|