Trying to understand where it's right to use "map" with a wildcard vs "paths".
Looking at the require source (but certainly not being 100% fluent with it) it seems like there would functionally be no difference between these two snippets. Is that true?
Using Paths:
require.config({
baseUrl: "include/js/",
paths: {
foo: "stuff/foo",
}
});
Using Map:
require.config({
baseUrl: "include/js/",
map: {
'*': {foo: "stuff/foo"},
}
});
From the RequireJS Docs "In addition, the paths config is only for setting up root paths for module IDs, not for mapping one module ID to another one."
This means "paths" is meant for mapping just the path to your resource when it is not in the default location (baseUrl). I guess this is what you were trying to do.
On the other hand, with "map" you can have several versions of your resource (foo1, foo2...) which you can map to be loaded from different paths (i.e. you want to load foo1 from a desktop browser and foo2 which is a modification of the first one from a mobile browser).
So, unless you have different versions of foo I would use "path" although you are right and "map" would also work in that case.