google-chrome - Chrome 显示空白的 TypeScript 文件

标签 google-chrome visual-studio-2013 typescript source-maps

我正在 visual studio 2013 中建立一个新的 TypeScript 项目。

我在我的 VS 项目上选择了生成源 map 的选项。我可以选择为 typescript 文件指定根目录,并为未选中的 sourcemap 文件指定根目录。

我在 Chrome 开发工具中选择了启用 JS sourcemaps 的选项。

在我生成的 app.js 文件的底部,我看到:

//# sourceMappingURL=app.js.map

并且该文件存在。

我没有在网络 Pane 中看到正在下载的源 map ,当我在源 Pane 中打开 .ts 文件时,我只看到一个空白文件。

有什么想法吗?谢谢!

最佳答案

将其放在您的 web.config 中以提供 TS 文件:

<configuration>
    ...
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".ts" mimeType="application/x-typescript" />
        </staticContent>
    </system.webServer>
</configuration>

关于google-chrome - Chrome 显示空白的 TypeScript 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31591887/

相关文章:

reactjs - 如何在react-calendar-timeline中添加自定义弹出窗口

javascript - 如何在以 Typescript 结尾的不同行的字符串中查找子字符串索引

javascript - AngularJS : WebSocket is closed before the connection is established in Google Chrome

php - Google chrome 会自动阻止 XSS 吗?

javascript - Uncaught ReferenceError : Cannot access 'Class' before initialization

c++ - VS 201 3's Compiler doesn' t 看不到 FLTK 库,但 VS 的 IntelliSense 确实适用于项目 Garland 的 QSlim

unit-testing - 用于调试在Visual Studio IDE(2013)中运行的LAST测试的键盘快捷方式

linux - 如何在 Google Chrome 中确保我的网站安全?

vb.net - VS 2013 和 Excel 2010 中的 Visual Basic : cannot find xlQualityStandard (is not declared)

json - Angular environment.ts 问题 JSON。然而 environment.prod.ts