const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
// 设置跨域代理
devServer: {
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
pathRewrite: {
'^/api': '/api'
}
}
},
},
// 设置访问路径以@开头查找
configureWebpack: {
resolve: {
alias: {
'@': resolve('src')
}
},
// 要排除的包 key 是要排除的包名:value(实际上是实际引入的包的全局的变量名)
// externals: externals
},
}