Files
system-file/web-vue/vite.config.js

42 lines
947 B
JavaScript
Raw Normal View History

2026-04-01 22:39:11 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'path'
const __dirname = dirname(fileURLToPath(import.meta.url))
2026-04-01 22:39:11 +08:00
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
base: '/', // 绝对路径,打包后 HTML 引用 /assets/...
build: {
outDir: resolve(__dirname, '../src/main/resources/webapp'),
emptyOutDir: true
},
2026-04-01 22:39:11 +08:00
server: {
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/ws': {
target: 'ws://localhost:8080',
ws: true
},
'/uploads': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/files': {
target: 'http://localhost:8080',
changeOrigin: true
}
}
}
})