| | |
| | | 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: "./", |
| | |
| | | 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: { |