Skip to content

Instantly share code, notes, and snippets.

@bryanforbes
Created December 26, 2011 17:09
Show Gist options
  • Save bryanforbes/1521659 to your computer and use it in GitHub Desktop.
Save bryanforbes/1521659 to your computer and use it in GitHub Desktop.
Curl conditional plugin bug
define([], function(){
return {
normalize: function(id, toAbsId){
var parts = id.split('?');
if(parts[0]){
parts = parts[1].split(':');
return toAbsId(parts[0]);
}
},
load: function(id, parentRequire, loaded){
if(id){
parentRequire([id], loaded);
}else{
loaded();
}
}
};
});
define([], function(){
return {
one: 1
};
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test Page</title>
<script>
var curl = { baseUrl: '..' };
</script>
<script src="../curl/src/curl.js"></script>
<script>
curl(['test/decider!condition?test/one:test/two'], function(test){
console.log(test);
});
</script>
</head>
<body>
</body>
</html>
define([], function(){
return {
two: 1
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment