From b3d89f70b2fefd7438eec61f7662da30ff8923c1 Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期五, 15 三月 2024 14:35:46 +0800 Subject: [PATCH] feat:道路数据接口 --- vite.config.ts | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index ebceb24..0acb882 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,12 +3,26 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { resolve } from "path"; +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' +//https://github.com/element-plus/unplugin-element-plus/blob/HEAD/README.zh-CN.md +import ElementPlus from 'unplugin-element-plus/vite' export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => { // const env = loadEnv(mode, process.cwd(), '') console.log(command, mode); return { plugins: [vue(), + AutoImport({ + resolvers: [ElementPlusResolver()], + }), + Components({ + resolvers: [ElementPlusResolver()], + }), + ElementPlus({ + // useSource: true + }) ], publicDir: "public", base: "./", @@ -17,7 +31,13 @@ port: 8112, open: false, strictPort: false, - // proxy: {} + proxy: { + '/api': { + target: 'http://192.168.3.87:8080', + changeOrigin: true, + rewrite: (path) => path.replace(/^\/api/, '') + } + } }, resolve: { alias: { -- Gitblit v1.8.0