55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
import { defineConfig } from "vite";
|
|
import { resolve } from "path";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import AutoImport from "unplugin-auto-import/vite";
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
server: {
|
|
host: '0.0.0.0',
|
|
open: true,
|
|
proxy: {
|
|
'/api': {
|
|
// target: 'http://192.168.2.161:18071/admin/',
|
|
// target: 'http://newadminapi.sxczgkj.cn/admin/',
|
|
// target: 'http://admintestapi.sxczgkj.cn/admin/',
|
|
// target: 'http://gw.sxczgkj.cn/admin/', // 测试
|
|
// target: 'http://192.168.2.128:18071/admin/',
|
|
target: 'http://192.168.2.23:7777/proxy/',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: '@import "@/style/root.scss";',
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
AutoImport({
|
|
include: [/\.vue$/, /\.vue\?vue/],
|
|
imports: [
|
|
"vue",
|
|
"vue-router",
|
|
"pinia",
|
|
{
|
|
"@/utils/enums.js": ["ENUMS"],
|
|
"element-plus": ["ElMessage"],
|
|
"@/hooks/index.js": [["default", "_hook"]],
|
|
},
|
|
],
|
|
eslintrc: {
|
|
enabled: false,
|
|
},
|
|
}),
|
|
],
|
|
});
|