Files
dvcp_v2_webapp/vite.config.js
2022-04-27 19:36:32 +08:00

38 lines
984 B
JavaScript

import {createVuePlugin} from 'vite-plugin-vue2'
import {defineConfig} from "vite";
export default defineConfig({
resolve: {
extensions: ['.vue', '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],
},
plugins: [createVuePlugin({jsx: true})],
server: {
host: '0.0.0.0',
port: 8666,
open: 'index.html',
proxy: {
//设置代理,可解决跨5
'/lan': {
target: 'http://192.168.1.87:9000',
changeOrigin: true,
rewrite: path => path.replace(/^\/lan/, '')
},
'/omsapi': {
target: 'http://192.168.1.87:19898',
changeOrigin: true,
rewrite: path => path.replace(/^\/omsapi/, '')
},
'/ns': {
target: 'http://localhost:12525',
changeOrigin: true,
rewrite: path => path.replace(/^\/ns/, '')
},
'/xsjr': {
target: 'http://192.168.1.87:39898',
changeOrigin: true,
rewrite: path => path.replace(/^\/xsjr/, '')
}
}
}
})