新建 vue.config.js 文件
module.exports = {
devServer: {
overlay: {
warnings: false,
errors: false
},
open:true, //自动开启浏览器
port:8000, //随便改端口号
proxy: {
'/api': {
target: 'https:猫眼.com',
//host: '*.*.com',
changeOrigin:true,
pathRewrite:{
'^/api':''
}
}
}
},
lintOnSave:false ,//直接关闭eslint检查,
configureWebpack: { //配置路径别名
resolve: {
alias: {
'assets': '@/assets',
'com': '@/components',
'views': '@/views',
}
}
}
}