angular.min.js.map 没有找到,它到底是什么? [英] angular.min.js.map not found, what is it exactly?

查看:35
本文介绍了angular.min.js.map 没有找到,它到底是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我加载页面并检查 chrome 控制台时,我发现这些错误:

When I load the page and check chrome console i find these errors:

angular 中的地图文件到底是什么?

what exactly are map files in angular?

我确实引用了 angular.min.js 但没有引用 angular.min.js.map.顺便说一下,我正在使用 angular 1.2 rc 版本,当我切换到此版本时,我才开始看到这些错误.

I did reference the angular.min.js but not the angular.min.js.map. I am using the angular 1.2 rc release by the way and I just started seeing these errors when i switched to this release.

ERRORS:
GET http://localhost:44786/Scripts/angular-route.min.js.map 404 (Not Found)       :44786/Scripts/angular-route.min.js.map:1
GET http://localhost:44786/Scripts/angular-animate.min.js.map 404 (Not Found) :44786/Scripts/angular-animate.min.js.map:1
GET http://localhost:44786/Scripts/angular-resource.min.js.map 404 (Not Found) :44786/Scripts/angular-resource.min.js.map:1
GET http://localhost:44786/Scripts/angular.min.js.map 404 (Not Found) :44786/Scripts/angular.min.js.map:1

推荐答案

正如 eaon21 和monkey 所说,source map 文件基本上将缩小的代码转换为未缩小的版本以进行调试.

As eaon21 and monkey said, source map files basically turn minified code into its unminified version for debugging.

您可以在此处找到 .map 文件.只需将它们添加到与缩小的 js 文件相同的目录中,它就会停止抱怨.他们被获取的原因是

You can find the .map files here. Just add them into the same directory as the minified js files and it'll stop complaining. The reason they get fetched is the

/*
//@ sourceMappingURL=angular.min.js.map
*/

在 angular.min.js 的末尾.如果您不想添加 .map 文件,您可以删除这些行,它会停止获取尝试,但如果您计划进行调试,保持源映射链接总是好的.

at the end of angular.min.js. If you don't want to add the .map files you can remove those lines and it'll stop the fetch attempt, but if you plan on debugging it's always good to keep the source maps linked.

这篇关于angular.min.js.map 没有找到,它到底是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆