Add Babel sourcemap to resolve VSCode debugging issues (#7022)

This commit is contained in:
Justin Grant
2019-10-09 23:20:18 -07:00
committed by Brody McKee
parent ac93f310bf
commit 09cbb89d44

View File

@@ -489,11 +489,11 @@ module.exports = function(webpackEnv) {
]
),
// @remove-on-eject-end
// If an error happens in a package, it's possible to be
// because it was compiled. Thus, we don't want the browser
// debugger to show the original code. Instead, the code
// being evaluated would be much more helpful.
sourceMaps: false,
// Babel sourcemaps are needed for debugging into node_modules
// code. Without the options below, debuggers like VSCode
// show incorrect code and set breakpoints on the wrong lines.
sourceMaps: shouldUseSourceMap,
inputSourceMap: shouldUseSourceMap,
},
},
// "postcss" loader applies autoprefixer to our CSS.