45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import AutoImport from 'unplugin-auto-import/vite';
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from 'path';
|
|
|
|
export default defineConfig({
|
|
plugins: [vue(),AutoImport({
|
|
imports: [
|
|
'vue',
|
|
'vue-router',
|
|
],
|
|
})],
|
|
resolve: {
|
|
alias: {
|
|
'~': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
server: {
|
|
host: true,
|
|
port: 3000,
|
|
proxy: {
|
|
// 业务接口:/plm/okn/ijb/* → https://d10vry7axuojk2.cloudfront.net/plm/okn/ijb/*
|
|
'/plm': {
|
|
target: 'https://d10vry7axuojk2.cloudfront.net',
|
|
ws: false,
|
|
changeOrigin: true,
|
|
},
|
|
// 埋点:/dcserv/api/eventTracking/{report|batchReport}.json
|
|
// → https://ap.dc-report.cc/api/eventTracking/{report|batchReport}.json
|
|
'/dcserv': {
|
|
target: 'https://ap.dc-report.cc',
|
|
ws: false,
|
|
changeOrigin: true,
|
|
rewrite: (p) => p.replace(/^\/dcserv/, ''),
|
|
},
|
|
//本地开发
|
|
'/qaz': {
|
|
target: 'https://d2yvsvw55p1b3a.cloudfront.net', // 这里是接口地址
|
|
ws: false,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|