Files
mengyanote/mengyanote-frontend/vite.config.js
2025-12-19 15:51:26 +08:00

30 lines
699 B
JavaScript
Raw Permalink 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 react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
base: './', // Ensure relative paths for assets
server: {
host: '0.0.0.0', // 监听所有网络接口(包括局域网)
port: 5173, // 端口号可选默认5173
proxy: {
// 开发环境代理配置
'/api': {
target: 'http://192.168.1.233:2424',
changeOrigin: true,
}
}
},
preview: {
host: '0.0.0.0',
port: 4173,
proxy: {
// 预览环境代理配置npm run preview
'/api': {
target: 'http://192.168.1.233:2424',
changeOrigin: true,
}
}
}
})