data-main in a subdirectory when baseUrl already defined #325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
RequireJS is great, and 2.0.2 fixes issues for me around plugins so I really need to use it. Unfortunately it looks like changes around data-main make it impossible to put your main script in a subdirectory now if you've already manually specified your baseUrl?
For example I've got the following config:
{
baseUrl: '/'
}
And my data-main="src/main" (I have other scripts in lib/ etc which I also need to reference)
Until 2.0.2 this worked fine, but since then requirejs tries to load in just /main.js instead of /src/main.js. This seems to be because of the changes around automatically setting the baseUrl.
This pull request changes the behaviour so that the whole data-main module name is used if a baseUrl is already set by the config, I also optimised a little to avoid doing any work on the URL if baseUrl is already set.
Thanks