angular.min.js.map not found, what is it exactly?

前端 未结 2 1272
Happy的楠姐
Happy的楠姐 2020-11-30 16:49

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

what exactl

相关标签:
2条回答
  • 2020-11-30 17:20

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

    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
    */
    

    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.

    0 讨论(0)
  • 2020-11-30 17:23

    Monkey is right, according to the link given by monkey

    Basically it's a way to map a combined/minified file back to an unbuilt state. When you build for production, along with minifying and combining your JavaScript files, you generate a source map which holds information about your original files. When you query a certain line and column number in your generated JavaScript you can do a lookup in the source map which returns the original location.

    I am not sure if it is angular's fault that no map files were generated. But you can turn off source map files by unchecking this option in chrome console setting

    enter image description here

    0 讨论(0)
提交回复
热议问题