Created
August 25, 2009 06:46
-
-
Save lsmith/174514 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add("myapp-base", function(Y){ | |
Y.MyApplication = function () {}; | |
// Class definition | |
Y.MyApplication.prototype = { | |
//... | |
}; | |
}, "3.0.0b1", {requires:["node"]}); | |
// Submodule definition | |
YUI.add("myapp-submodule", function(Y){ | |
//... | |
}, "3.0.0b1", {requires:["myapp-base"]}); | |
// Rollup definition | |
YUI.add("myapp", function(Y){}, "3.0.0b1", {use: ["myapp-base", "myapp-submodule"]}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/my/local/yui3/build/yui/yui.js"></script> | |
<script src="custom_module.js"></script> | |
<script> | |
// This does not work | |
YUI({ | |
base: '/my/local/yui3/build/', | |
modules:{ | |
myapp:{ | |
requires:["node"] // should be unnecessary, but fails even without this | |
} | |
} | |
}).use("myapp", function(Y) { | |
// Node is NOT loaded | |
debugger; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/my/local/yui3/build/yui/yui.js"></script> | |
<!--script src="custom_module.js"></script--> | |
<script> | |
// This works | |
YUI({ | |
base: '/my/local/yui3/build/', | |
modules:{ | |
myapp:{ | |
fullpath: 'custom_module.js', | |
requires:["node"] | |
} | |
} | |
}).use("myapp", function(Y) { | |
// Node is loaded | |
debugger; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment