初始
This commit is contained in:
55
vite.config.ts
Normal file
55
vite.config.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
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: " 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}/*"],
|
||||
// },
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user