dhjk/vite.config.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-07-04 16:54:37 +08:00
import { defineConfig } from "vite";
import { fileURLToPath, URL } from 'url'
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
// import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
AutoImport({
// resolvers: [ElementPlusResolver()],
}),
Components({
// resolvers: [ElementPlusResolver()],
}),
],
resolve: {
extensions: ['.js', '.vue'],
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
host: '0.0.0.0', // 解决“vite use `--host` to expose”-- 0.0.0.0 将监听所有地址
proxy: {
'/api': {
2023-07-10 17:30:13 +08:00
// target: 'http://10.0.0.29:9999',
2023-07-07 16:48:16 +08:00
// target: 'https://fywz.btdit.cn/',
2023-07-11 17:11:14 +08:00
target: 'http://10.0.0.65:7777/', // 刘进
2023-07-04 16:54:37 +08:00
changeOrigin: true,
2023-07-11 17:11:14 +08:00
// rewrite: (path) => path.replace(/^\/api/, '')
2023-07-04 16:54:37 +08:00
// ws: true,// 开启webSocket
}
}
}
});