123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig, loadEnv } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import AutoImport from 'unplugin-auto-import/vite'
- import Components from 'unplugin-vue-components/vite'
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
- export default defineConfig(({ command, mode }) => {
- const env = loadEnv(mode, process.cwd(), '')
- return {
-
-
-
-
-
- base: `/${env.VITE_BASE_URL}`,
-
-
-
-
-
- plugins: [
- vue(),
- AutoImport({
- resolvers: [ElementPlusResolver()],
- }),
- Components({
- resolvers: [ElementPlusResolver()],
- }),
- ],
-
-
-
-
-
- server: {
-
- host: '0.0.0.0',
-
- port: 8001,
-
-
-
-
-
-
-
- proxy: {
- [env.VITE_REQUEST_BASE]: {
- target: 'http://127.0.0.1:9000',
- ws: false,
- changeOrigin: true,
-
- },
- [env.VITE_APP_ADMIN_BASE_API]: {
- target: 'http://127.0.0.1:9001',
- ws: false,
- changeOrigin: true,
- }
- },
-
-
-
-
- },
-
- build: {
- outDir: 'shuitou'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url)),
- },
- },
- }
- })
|