You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
505 B
20 lines
505 B
module.exports = {
|
|
configureWebpack: {
|
|
resolve: {
|
|
alias: {
|
|
'@src': require('path').resolve(__dirname, 'src'), // 配置别名 '@src' 指向 'src' 目录
|
|
},
|
|
},
|
|
},
|
|
devServer: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3000', // 后端 API 地址
|
|
changeOrigin: true, // 是否允许跨域
|
|
pathRewrite: {
|
|
'^/api': '', // 重写路径,将 '/api' 移除
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|