Firebug does not display my JavaScript files

浪子不回头ぞ 提交于 2019-12-20 06:37:30

问题


I am building a web application with AngularJS en typescript in VS2012. These TypeScript files are all compiled into JavaScript files and send to the client using Bundles (all options turned off, thus I'm sending all files individually).

In Firebug HTML view I can see all my JavaScript files, but in the scripts tab, only my TypeScript files are visible. Am I missing a configuration here to display my JavaScript files? I can add a mime type to serve the TypeScript files, but then I loose my debugging powers.


回答1:


Most likely reason: you are using Source Maps.

When you use source maps, the browser is able to show the source code that relates to the transpiled JavaScript code.

You can switch source maps on and off as it is a compiler setting.

tsc --sourceMap app.ts

Update

I have tested this out and it is definitely source maps.

If you update your compiler settings (or your TypeScript -> Debugging -> Source Maps setting in your Visual Studio project) and delete your .map files, you'll see the JavaScript in Firefox.

It is down to your individual preferences - seeing the actual source can be useful.



来源:https://stackoverflow.com/questions/30940944/firebug-does-not-display-my-javascript-files

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