const { defineConfig } = require('@vue/cli-service') const NodePolyfillPlugin = require('node-polyfill-webpack-plugin') module.exports = defineConfig({ publicPath: '/', transpileDependencies: true, configureWebpack: { plugins: [new NodePolyfillPlugin()] }, devServer: { port: 12306, // 端口 proxy: { '/authorize': { // 若请求的前缀不是这个'/wms',那请求就不会走代理服务器 target: "https://login.microsoftonline.com/caterpillar.onmicrosoft.com/", //这里写路径 pathRewrite: { '^/authorize': '' }, //将所有含/wms路径的,去掉/wms转发给服务器 ws: true, //用于支持websocket changeOrigin: true //用于控制请求头中的host值 }, } }, })