vs 開發的調試 - daniel-qa/Vue GitHub Wiki
vs 開發的調試
- 例外狀況的調試
VS 上方選單:Debug(偵錯) → Windows(視窗) → Exception Settings(例外設定)

取消鉤選,可以避刷在 Run Debug 時,一直被警告中斷的情形
- 忽略憑證的檢查
devServer: {
progress: false,
https: true, // 启用 HTTPS
proxy: {
'/api': {
target: 'https://your-api-url',
secure: false, // 忽略证书错误
changeOrigin: true, // 确保请求头中的主机字段与目标一致
},
},
},
- 比較完整的代碼
module.exports = {
outputDir: '../wwwroot',
lintOnSave: false,
transpileDependencies: ['@azure'],
productionSourceMap: false, // 设置上线后是否加载webpack文件
devServer: {
progress: false,
https: true, // 启用 HTTPS
proxy: {
'/api': {
target: 'https://your-api-url',
secure: false, // 忽略证书错误
changeOrigin: true, // 确保请求头中的主机字段与目标一致
},
},
},
pages: {
app: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'index.html',
},
},
...