pre-warning-system/vite.config.js
2025-06-20 16:03:24 +08:00

25 lines
750 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 { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
}
})
// server: {
// port: 5500, // 自定义端口
// host: true, //false只允许127.0.0.0本地访问true表示统一局域网的人都能通过ip访问
// open: true, // 自动打开浏览器
// proxy: { // API代理 前端发起以/api/xx的请求,都会被Vite的开发服务器拦截,并转发到目标服务器。
// '/api': {
// target: 'http://backend:8080',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, '')
// }
// }
// }