How to stop Angular from loading the .angular.min.js.map file when extracting Angular from CDN?

I am working on a site that downloads AngularJS from a CDN, and together with Angular it downloads a 284KB map file (angular.min.js.map), which, as I understand it, is intended for debugging.

I don’t want to debug, it goes into production, and 284 KB is a lot! How to stop downloading this file?

I can’t edit the file (CDN), and it doesn’t matter what Google Chrome settings I have, I cannot advise others to change their settings in order to use the website I'm working on.

thanks

+6
source share
3 answers

According to http://blog.teamtreehouse.com/introduction-source-maps

Developer tools will only download this file if source map support is enabled and the developer tools are open.

Thus, any influence will be felt only when someone opens their tools to developers, which, I suspect, are acceptable, since in this case the ability to debug is more important than the download speed / size.

+5
source

Inside the Google Chrome inspector, have you turned off "Enable source JavaScript maps" in "Settings"> "General"?

I think your dev installation is trying to pull out the source map file, although for others without this option checked in the Chrome inspector, this will not be a problem.

+1
source

Do not worry about source map files for production.

Only if the user has hrome dev tools or other browser compatible browsers compatible with the source map, they will request and download the files / files of the source map.

+1
source

Source: https://habr.com/ru/post/970820/


All Articles