123456789101112131415161718192021222324252627282930 |
- import {defineConfig, loadEnv} from 'vite'
- import vue from '@vitejs/plugin-vue'
- import {resolve} from 'path'
- const pathResolve = (dir: string): any => {
- return resolve(__dirname, '.', dir)
- }
- export default defineConfig(mode => {
- const env = loadEnv(mode.mode, process.cwd());
- const alias: Record<string, string> = {
- '/@': pathResolve('./src/'),
- "@": pathResolve("./src"),
- };
- return {
- server: {
- port: 5173,
- strictPort: false,
- //proxy: {
- // "/api": {
- // target: 'http://120.79.56.64:8025',
- // rewrite: (path) => path.replace(/^\/api/, '')
- // },
- //}
- },
- base: env.VITE_APP_Vitrural,///根据实际情况确定虚拟目录
- resolve: {alias},
- plugins: [vue()]
- };
- })
|