Require to add ".map" to javascript, not ".js" all of a sudden

I had it fine, until today, when all of my js files loaded with requirejs suddenly can not be found, but because requirejs decided to give everyone a .map file extension, not ".js"

I added ".js" to the view-only paths, and then requirejs still failed because it pointed to "jquery.min.js.js"

I am puzzled at how this will suddenly change for no reason. Does anyone have any idea?

require.config baseUrl: 'javascripts' paths: jquery: 'vendor/jquery-1.10.2.min' underscore: 'vendor/underscore.min' backbone: 'vendor/backbone.min' shim: underscore: exports: '_' backbone: deps: ["underscore", "jquery"] exports: "Backbone" require [ 'jquery', 'underscore', 'backbone'#, ], ($, _, Backbone) -> $('body').prepend "<div class='marking-up-header'></div>" 

Again it worked perfectly when I last worked on it and came back to it today, it was scared. enter image description here

Ok, so I completely took out require.js, and now I have all the same missing errors with ".map". I opened it in safari (I used chrome) and I do not get these errors at all. Does Chrome have a stroke? somebody knows?

Thanks.

+7
javascript jquery google-chrome requirejs
source share
2 answers

As @alexanderb noted, this is due to recent support for source maps in Chrome. To avoid this (if you are not interested in using source maps for mini files), go to the Dev Tools settings panel and uncheck the "Enable source maps" checkbox in the "Sources" section. Please note, however, that this disables the functionality of the source map for all the mini files that indicated the source map using // @ sourceMappingURL=jquery-1.10.2.min.map . No need to edit files.

+7
source share

This is probably due to your links to mini files.

As a rule, you always use uncompressed sources, and then optimize the code with r.js during deployment, so that all the mentioned libraries will still work.

Try going from the path section and see if the problem appears.

+2
source share

All Articles