41 lines
800 B
TypeScript
41 lines
800 B
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { compilerOptions } from 'vue3-pixi'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue({
|
|
template: {
|
|
compilerOptions,
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src')
|
|
}
|
|
},
|
|
build: {
|
|
assetsDir: 'web_static', // 避免与游戏原本的 /assets 目录冲突
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8002',
|
|
changeOrigin: true,
|
|
},
|
|
'/ws': {
|
|
target: 'ws://localhost:8002',
|
|
ws: true,
|
|
changeOrigin: true,
|
|
},
|
|
'/assets': {
|
|
target: 'http://localhost:8002',
|
|
changeOrigin: true,
|
|
}
|
|
}
|
|
}
|
|
})
|