Debugging TypeScript in Firebug

岁酱吖の 提交于 2019-12-23 09:34:18

问题


Is there any instruction how to debug typescript in Firebug and/or built-in Firefox js-debugger? Something like but for Firebug and/or Firefox


回答1:


Firefox Developer Edition allows debugging of TypeScript code. The only thing missing is syntax highlighting.




回答2:


Chrome canary supports this: http://www.aaron-powell.com/web/typescript-source-maps




回答3:


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.

For Coffeescript, there is AceBug which 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.




回答4:


Firebug version 3.0 is 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.

You can try out preview releases from http://getfirebug.com/releases/firebug/3.0/




回答5:


Current version of Firebug (2.0.13 + FF43) seems to be debugging typescript just fine. At least it worked for me so far.

On the web page you add the "compiled" .js with a reference to the source map. I.e.

<script src="register.js"></script>

And Firebug will show you the register.ts file instead in the list of scripts instead.

Make sure you have the source map generation on in your tsconfig.json:

"compilerOptions": {
    ...
    "sourceMap": true
},


来源:https://stackoverflow.com/questions/12836494/debugging-typescript-in-firebug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!