vscode 在调试 React 应用程序时,设置断点和命中第一个断点现在非常慢

Setting breakpoints and hitting the first breakpoint is now very slow in vscode when debugging a React app

这几天前工作得更好,但现在,当我想在 Chrome 中调试我的 CRA webapp 时,我在设置或命中断点时有很大的延迟(10 - 20 秒)。现在我什至收到来自 vscode

的消息

这么说

It's taking a while to configure your breakpoints. You can speed this up by updating the 'outFiles' in your launch.json".

问题是:我在调试 React 应用程序时没有输出文件。

我必须在那里设置什么?附注:我正在使用内置的 Chrome 调试器支持,而不是已弃用的 Chrome 扩展。

事实证明,在生产构建中包含 Typescript 源映射导致了长时间的延迟。这些文件非常大(比实际代码大),因此需要很长时间才能加载。

在我的项目中,我启用了源映射作为 Babel 构建的一部分。这样我就可以在 Visual Studio 代码 Web 视图中调试 Typescript 代码。