module.exports = {
publicPath: "/", // 部署應⽤包時的基本 URL
outputDir: "dist", // npm run build ⽣成的⽂件夾,默認是dist
assetsDir: "static", // 在kaixin⽂件夾下⾯⽣成static⽬錄存放js,img,css等靜態資源
indexPath: "index.html", // ⽣成的單⽂件的,⽂件名,
devServer: {
host: "127.0.0.1", // 配置主機地址
port: process.env.NODE_ENV == 'production' ? 3000 : 8888, // 配置運⾏的端⼝
// proxy: "接⼝地址", 跨域代理! 【重要!】
proxy: { // 配置多個!
'/api': {
target: 'http://localhost:3030/api',
ws: true, // 跨域地址是https協議!
changeOrigin: true,
pathWrite: {
"^/api": "" // 將 '/api' 替換成 ''
}
}
},
}
}