修改如下:
module.exports = { // ... many config ... productionSourceMap: process.env.NODE_ENV === 'development', // ... many config ... configureWebpack: { devtool: process.env.NODE_ENV === 'development' ? 'source-map' : undefined, // ... many config ... } }
另:上述的development要看你本地配置,有的是dev