Dojo config: Map with absolute path value


#1

I’m using the map property in my dojoConfig (with no baseUrl explicitly set), like this:

map: {
  'some/module': {
    'src/foo.js': 'baz/bar.js'
  }
},

But I’d like to load bar.js by an absolute path instead, like https://some-host.com/bar.js. I tried this:

map: {
  'some/module': {
    'src/foo.js': 'https://some-host.com/bar.js'
  }
},

But that gives me http://path-to-my-site.com/https:/some-host.com/bar.js.

I haven’t been able to figure out how to load a module via its absolute path using the map config object. Any ideas?


#2

map is supposed to map AMD dependencies, and should generally not be used for mapping file names, though it worked ok in your first case.

I think here you actually want to specify paths inside the map, though honestly I don’t know if the syntax supports what you are trying to do. See https://www.sitepen.com/blog/2013/06/20/dojo-faq-what-is-the-difference-packages-vs-paths-vs-aliases/ for a bit more detail on paths.