1. 在vue.config.js下增加devtool: 'cheap-module-source-map',
const vueConfig = { configureWebpack: { // devtool: '', devtool: 'cheap-module-source-map', // webpack plugins plugins: [ // Ignore all locale files of moment.js new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/) ] }, }
2. 在vue.config.js下設置productionSourceMap: true
調試的時候可以設置為true,之后需要設置為false,防止代碼泄露
