zycp-demo/vue.config.js

19 lines
840 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

module.exports = {
lintOnSave: true,
// 配置webpack打包
configureWebpack: (config) => {
// 取消console打印
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
},
devServer: {
proxy: {
'/api': {
target: 'https://ypzy.emingren.com', // 你请求的第三方接口
changeOrigin: true, // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
pathRewrite: { // 路径重写,
'^/api': '' // 替换target中的请求地址也就是说以后你在请求https://ypzy.emingren.com这个地址的时候直接写成/api即可。
}
}
}
}
}