I am trying to load scripts from a CDN (cdnjs to be specific), and in requirejs you have to leave the extension off like so:
require.config({
baseUrl: '/static/js/',
paths: {
underscore: ['//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.1/underscore-min']
},
shim: {
'underscore': {
exports: '_'
}
}
});
But when I do this, the browser tries to load underscore-min.map
and not underscore-min.js
.
How do I fix this, and also what is a .map
?
.map
files are needed for sourceMap support in the browser. This is the last line from the file you load from the CDN:
//# sourceMappingURL=underscore-min.map
This line makes your browser to load the .map
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With