Files
my-bigScreen/screen-vue/vite.config.js

33 lines
711 B
JavaScript
Raw Normal View History

2026-02-24 23:26:41 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { fileURLToPath } from 'url'
import { dirname } from 'path'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
// 开发环境代理(适配后端接口)
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:31001',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
// 打包配置
build: {
outDir: 'dist',
base: '/',
assetsDir: 'assets'
}
})