Skip to content

Commit 09cbb89

Browse files
justingrantmrmckeb
authored andcommitted
Add Babel sourcemap to resolve VSCode debugging issues (#7022)
1 parent ac93f31 commit 09cbb89

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/react-scripts/config/webpack.config.js

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

0 commit comments

Comments
 (0)