-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fix referencing a sub path relatively from the base dir #95
Conversation
@gfranko any chance you can take a look at this? Thanks |
@gfranko do you have time to look at this? it seems like an obvious problem |
Could you describe the problem in more detail, maybe a testcase? Normally @gfranko acts very quickly quite likely he's on vacation right now. |
I did add a test case in this PR. any define that is without a path (see test case) it incorrectly generates the variable names for required modules, adding an additional |
@@ -286,7 +286,13 @@ define([ | |||
return pluginName + dep; | |||
} | |||
|
|||
return pluginName + normalizePath([baseName(moduleId), dep].join('/')); | |||
var moduleBaseName = baseName(moduleId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if baseName(moduleId)
is "" then it gets added as an empty element to the array, causing the array to begin with /
when it shouldn't. The generated variable name then doesn't match the one generated for dependencies because it has an additional _
at the begining.
@gfranko any chance you can take a look? |
1 similar comment
@gfranko any chance you can take a look? |
Hey this solved a same issue i was having! Stable [email protected] does: input: define(['jquery', 'templates', 'variables', 'json!./data.json'], function(.... output: }(jquery, templates, variables, json__datajson); // note double underscore This branch fix this like a charm: output: }(jquery, templates, variables, json_datajson); // single underscore Any chance to merge this? |
@gfranko ?? |
Meanwhile, since i can't wait to see this fix on reaching for some release, i had to turn my code from 'json!./data.json' into 'json!data.json'. |
@lukeapage thanks for fixing this! |
Fix referencing a sub path relatively from the base dir
See tests..
I thought it might be a loader problem but it looks more general..