在 Firebug 中调试 TypeScript
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12836494/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Debugging TypeScript in Firebug
提问by Dis Shishkov
采纳答案by Tom Lint
Firefox Developer Editionallows debugging of TypeScript code. The only thing missing is syntax highlighting.
Firefox Developer Edition允许调试 TypeScript 代码。唯一缺少的是语法突出显示。
回答by Jeremy Danyow
Chrome canary supports this: http://www.aaron-powell.com/web/typescript-source-maps
Chrome 金丝雀支持这个:http: //www.aaron-powell.com/web/typescript-source-maps
回答by David Gardiner
Firebug version 3.0is being designed to run on top of the built-in debugger in Firefox. This means it also leverages the support for source maps and so the .ts files are loaded correctly.
Firebug 3.0 版旨在运行在 Firefox 的内置调试器之上。这意味着它还利用了对源映射的支持,因此 .ts 文件可以正确加载。
You can try out preview releases from http://getfirebug.com/releases/firebug/3.0/
回答by Valentin
Firebug is closely integrated with the Javascript execution engine of Firefox. As long as Firefox or Firebug have no support for Typescript I guess you are out of luck.
Firebug 与 Firefox 的 Javascript 执行引擎紧密集成。只要 Firefox 或 Firebug 不支持 Typescript,我想你就不走运了。
For Coffeescript, there is AceBugwhich offers debugging support for Coffeescript. It should be possible to extend this to TypeScript. However, the structure of the source Typescript and the compiled Javascript can be quite different so the compiler would need to insert debug symbols to link Javascript to Typescript.
对于 Coffeescript,有 AceBug,它为Coffeescript提供调试支持。应该可以将其扩展到 TypeScript。但是,源 Typescript 和编译后的 Javascript 的结构可能大不相同,因此编译器需要插入调试符号以将 Javascript 链接到 Typescript。
回答by Okneloper
Current version of Firebug (2.0.13 + FF43) seems to be debugging typescript just fine. At least it worked for me so far.
当前版本的 Firebug (2.0.13 + FF43) 似乎可以很好地调试打字稿。至少到目前为止它对我有用。
On the web page you add the "compiled" .jswith a reference to the source map. I.e.
在网页上,您添加“已编译”的.js并引用源映射。IE
<script src="register.js"></script>
And Firebug will show you the register.tsfile instead in the list of scripts instead.
Firebug 会在脚本列表中向您显示register.ts文件。
Make sure you have the source map generation on in your tsconfig.json:
确保在 tsconfig.json 中生成源映射:
"compilerOptions": {
...
"sourceMap": true
},

