i trying understand how source maps work. created simple web server 1 page using nodejs. installed jquery comes minified version , source maps. put script tag on web page including minified version of jquery. can browse through unminified code in chrome developer tools source maps. how?
i analyze stuff sent server , source maps not transferred. not shown in network tab of chrome developer tools , not included in downloaded content of minified jquery file. thing //# sourcemappingurl=jquery.min.map
@ end of minified jquery file. how can browser access them?
i partly wondering because in work creating application , nice have ability trace errors source maps in production. seems if want allow that, means visiting site can unminified code. correct or can control how source maps transferred client server?
edit: answers. did bit more research myself logging each request server received. if debugger tools used, source maps requests @ url specified in end of minified file. fact chrome hides makes stuff confusing. if block source map being transferred, source mapping not work chrome cache source map. i.e. if allow source map, view it, block , view again source mapping may still work.
source maps indeed transferred, in current versions of chrome not shown in network tab. according this answer, source maps used visible on network tab, @ point decided change requests no longer visible.
as keeping source maps private, 1 of solutions mentioned in this answer create .htaccess
file restricts source map access clients local network. way set authentication, have log in site able view source maps or else 403.
Comments
Post a Comment