58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import { defineConfig } from "vite";
|
||
import vue from "@vitejs/plugin-vue";
|
||
import { resolve } from "path";
|
||
import path from "path";
|
||
// 自动导入vue中hook reactive ref等
|
||
import AutoImport from "unplugin-auto-import/vite";
|
||
//自动导入ui-组件 比如说ant-design-vue element-plus等
|
||
import Components from "unplugin-vue-components/vite";
|
||
|
||
export default defineConfig({
|
||
resolve: {
|
||
alias: {
|
||
"@": path.resolve(__dirname, "src"),
|
||
},
|
||
},
|
||
plugins: [
|
||
vue(),
|
||
AutoImport({
|
||
//安装两行后你会发现在组件中不用再导入ref,reactive等
|
||
imports: ["vue", "vue-router"],
|
||
//存放的位置
|
||
dts: "src/auto-import.d.ts",
|
||
}),
|
||
Components({
|
||
// 引入组件的,包括自定义组件
|
||
// 存放的位置
|
||
dts: "src/components.d.ts",
|
||
}),
|
||
],
|
||
server: {
|
||
proxy: {
|
||
"/basic-api": {
|
||
// target: 'http://api.holo-land.com/',
|
||
// target: 'http://lh.holo.huatengkexun.com/',
|
||
// target: "http://chen.hnedu.huatengkexun.com/",
|
||
// target: "https://hnaicm.admin.huatengkexun.com/",
|
||
// target: "https://tk2.aicm.huatengkexun.com/",
|
||
// target: "https://hnaicm.admin.huatengkexun.com/",
|
||
target: "http://localhost:6669/", //生产
|
||
|
||
changeOrigin: true,
|
||
// ws: true,
|
||
rewrite: (path) => path.replace(/^\/basic-api/, ""),
|
||
},
|
||
"/ai-basic-api": {
|
||
target: "https://hn.dify.holo-land.com/",
|
||
changeOrigin: true,
|
||
// ws: true,
|
||
rewrite: (path) => path.replace(/^\/ai-basic-api/, ""),
|
||
},
|
||
},
|
||
open: true, // 项目启动后,自动打开
|
||
// warmup: {
|
||
// clientFiles: ["./index.html", "./src/{views,components}/*"],
|
||
// },
|
||
},
|
||
});
|