123456789101112131415161718192021222324252627282930313233343536 |
- import { fileURLToPath, URL } from 'node:url';
- import { defineConfig, loadEnv } from 'vite';
- import vue from '@vitejs/plugin-vue';
- export default defineConfig(({ mode }) => {
- const env = loadEnv(mode, __dirname);
- return {
- // 静态路径
- base: env.VITE_BASE_URL,
- // 打包名称
- build: {
- outDir: env.VITE_OUT_DIR
- },
- plugins: [vue()],
- server: {
- host: '0.0.0.0',
- port: 8001,
- proxy: {
- '/files': {
- target: 'http://120.48.146.1', // https://broadcast.waityou24.cn
- changeOrigin: true
- },
- '/usedCar/api': {
- target: 'http://127.0.0.1:9800', //https://www.ccwit.net
- changeOrigin: true,
- ws: false
- }
- },
- fs: { strict: false }
- },
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- }
- }
- };
- });
|