// const { defineConfig } = require('@vue/cli-service') // module.exports = defineConfig({ // transpileDependencies: true, // lintOnSave:false // }) module.exports = { pages:{ index:{ //入口 entry:'src/main.js', }, }, lintOnSave:false, //关闭语法检查 // 开启代理服务器(方式一) // devServer: { // proxy: 'http://localhost:5000' // }, // 开启代理服务器(方式二) devServer: { proxy: { '/api': { //此处的/api是请求前缀,也可以换成其它的名称,比如:/atguigu target: 'http://localhost:5000', pathRewrite:{'^/api':''}, //表示转发给服务器时,将前缀去掉,否则请求不成功 ws: true, // 用于支持websocket,默认为true changeOrigin: true //用于控制请求头中的host值,默认为true }, '/demo': { target: 'http://localhost:5001', pathRewrite:{'^/demo':''}, ws: true, changeOrigin: true }, } } }