简体   繁体   English

源地图根本没有加载

[英]Source maps not loading at all

I'm trying to make source maps for AngularJS show in Chrome's developer tools. 我正在尝试在Chrome的开发人员工具中显示AngularJS的源地图。 I made a simple webpage: 我做了一个简单的网页:

<!DOCTYPE html>
<html lang="en" ng-app>
<head>
    <meta charset="utf8">
    <title>Some App</title>
    <script src="lib/angular.min.js"></script>
</head>
<body>

<h1>Hello world! {{ 1+2 }}</h1>

</body>
</html>

This was saved as index.html , then I copied three AngularJS files ( angular.js , angular.min.js and angular.min.js.map ) straight from Angular's bower repository into the lib subdirectory, then made sure that the “Enable source maps” option is turned on in the developer tools' settings page. 这被保存为index.html ,然后我直接从Angular的 angular.min.js.map 存储库中复制了三个AngularJS文件( angular.jsangular.min.jsangular.min.js.map )到lib子目录中,然后确保“启用”源地图”选项在开发人员工具的设置页面中处于启用状态。 I serve the contents of this directory using python -m SimpleHTTPServer . 我使用python -m SimpleHTTPServer提供该目录的内容。 Yet Chrome doesn't even query the server for the map file—that would show up in the server's logs. 但是,Chrome甚至不向服务器查询地图文件,该文件会显示在服务器的日志中。

Then I tried loading the source map demos like the Coffee Script demo or demos linked on HTML5Rocks page… none of them actually load the map files, which I guess would show up in the “Network” tab. 然后,我尝试加载诸如Coffee Script演示HTML5Rocks页面上链接的演示之类的源地图演示……它们都没有实际加载地图文件,我想它们会显示在“网络”标签中。

This is Chrome 28.0.1500.95 on a Debian SID system. 这是Debian SID系统上的Chrome 28.0.1500.95。

What I am doing wrong? 我做错了什么?

因此,显然Chrome仅在Chrome 30中处理“ //# ”新语法。http ://code.google.com/p/chromium/issues/detail?id=258349

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM