如何让打字稿文件在原始文件中而不是在动态选项卡中打断点? [英] How to get Typescript files to hit breakpoints in the original file, not in Dynamic tab?

查看:20
本文介绍了如何让打字稿文件在原始文件中而不是在动态选项卡中打断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在升级到 Visual Studio Premium 2013 Update 2 RC 之前,当我在 Typescript 文件中添加断点时,该断点将在原始 Typescript 文件中命中.但是,升级后,当断点命中时,Visual Studio 中会打开一个带有标题的新选项卡,并且代码在动态文件而不是原始打字稿文件中暂停.如何使断点再次命中原始 Typescript 文件?我已将打字稿文件属性标记为请勿复制",所以我不明白为什么将其视为动态?这里没有动态生成任何东西?

Before upgrading to Visual Studio Premium 2013 Update 2 RC, when I add a breakpoint in a Typescript file, the breakpoint will hit in the original Typescript file. However, after the upgrade, when the breakpoint hits, a new tab in Visual Studio opens with the title and the code pauses in the dynamic file instead of the original typescript file. How can I make the breakpoints hit in the original Typescript file again? I have marked the typescript file properties to be "Do not copy", so I don't understand why it is being considered as Dynamic? Nothing is being generated on the fly here?

推荐答案

您是否看到 .map 文件和 .js 文件?当你编译你的打字稿时,你需要使用 -sourcemap

Do you see a .map file along w/ a .js file? When you compile your Typescript you need to use the compiler option of -sourcemap

这将创建一个 .map 文件,VS2013 使用它来了解如何将 js 文件映射到您的打字稿文件.

This will create a .map file that VS2013 uses to know how to map the js file to your typescript file.

所以在你的文件夹中你应该看到:

so in your folder you should see:

  • file.ts
  • file.js
  • file.js.map

这篇关于如何让打字稿文件在原始文件中而不是在动态选项卡中打断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆