jrburke/requirejs — Issue #163: ".js" automatically appended to every request
Author: treshugart
Created: 2012-01-06 05:41:08+00:00
State: open

I was scratching my head for awhile because the Google Maps API was complaining that I wasn't specifying the "sensor" parameter. Turns out it's because ".js" is being appended to my path.

Here is my config:

require.config({
baseUrl: 'js',
paths: {
google: 'http://maps.google.com/maps/api/js?libraries=places&sensor=false'
}
});

The request that is being made:

http://maps.google.com/maps/api/js?libraries=places&sensor=false.js

Shouldn't it be:

http://maps.google.com/maps/api/js?libraries=places&sensor=false

If this is the desired behaviour wouldn't this be hindering anyone from using any CDN that doesn't use ".js" as an extension when loading resources?

Actually, IMHO, I think there should be the ability to turn of the appending of ".js" since there are situations where resources maybe loaded without an extension, even on the same domain.

Cheers.

Trey