| 123456789101112131415161718192021222324252627282930 |
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- // https://vitejs.dev/config/
- export default defineConfig({
- server: {
- https: false,
- // 是否自动在浏览器打开
- open: true,
- cors: true,
- proxy: {
- '/api': {
- target: 'http://127.0.0.1:8000', // 接口域名,接口服务器地止
- changeOrigin: true,
- secure: false,
- // rewrite: (path) => path.replace(/^\/api/, '')
- },
- }
- },
- plugins: [
- vue(),
- ],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- }
- }
- })
|