vue项目配置代码
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = 'rz-shop' // 网址标题
const port = 8081 // 端口配置
module.exports = {
publicPath: "/",
lintOnSave: false,
productionSourceMap: false, // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: {
progress: true,
port: port,
open: false,
overlay: {
warnings: false,
errors: true,
},
proxy: {
"/api": {
target: "",
changeOrigin: true,
ws: true,
pathRewrite: {
"^/api": "",
},
},
},
}
};