? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? vue項(xiàng)目配置代碼
const?path?=?require('path')
function?resolve(dir)?{
????return?path.join(__dirname,?dir)
}
const?name?=?'rz-shop'?//?網(wǎng)址標(biāo)題
const?port?=?8081?//?端口配置
module.exports?=?{
??publicPath:?"/",
??lintOnSave:?false,
??productionSourceMap:?false,?//?如果你不需要生產(chǎn)環(huán)境的?source?map,可以將其設(shè)置為?false?以加速生產(chǎn)環(huán)境構(gòu)建。
??devServer:?{
????progress:?true,
????port:?port,
????open:?false,
????overlay:?{
??????warnings:?false,
??????errors:?true,
????},
????proxy:?{
??????"/api":?{
????????target:?"",
????????changeOrigin:?true,
????????ws:?true,
????????pathRewrite:?{
??????????"^/api":?"",
????????},
??????},
????},
??}
};