Skip to content

data-main in a subdirectory when baseUrl already defined #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2012

Conversation

spmason
Copy link
Contributor

@spmason spmason commented Jun 13, 2012

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

jrburke added a commit that referenced this pull request Jun 18, 2012
jrburke added a commit that referenced this pull request Jun 18, 2012
data-main in a subdirectory when baseUrl already defined
@jrburke jrburke merged commit c1e413b into requirejs:master Jun 18, 2012
jrburke added a commit that referenced this pull request Jun 18, 2012
@jrburke
Copy link
Member

jrburke commented Jun 18, 2012

Thanks, merged! Will be part of 2.0.3 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy