Files
vue-tickets/vite.config.js
2026-02-25 09:38:25 +08:00

33 lines
707 B
JavaScript
Raw 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 { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
base: '/', // 添加这一行,确保部署在根目录或通过Nginx运行目录指向时路径正确
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
port: 80, // 前端启动的端口
proxy: {
'/api': { // 所有以api开头的请求都会被代理
target: 'http://112.5.15.136:25536',
changeOrigin: true,
}
}
}
})