楼上正解。overlay有更精细的控制。补充贴一下: module.exports = { //... devServer: { overlay: { warnings: true, errors: true } } };
devServer中设置 overlay: true