Skip to content

Instantly share code, notes, and snippets.

@davglass
Created October 10, 2011 16:13
Show Gist options
  • Save davglass/1275713 to your computer and use it in GitHub Desktop.
Save davglass/1275713 to your computer and use it in GitHub Desktop.
YUI({
combine: true,
modules: {
'my-module': {
fullpath: "my-module.js",
type: 'js',
requires: [ "event","event-custom","event-valuechange" ]
},
'my-module-2': {
fullpath: "my-module-2.js",
type: 'js',
requires: [ "history","io","json-parse","node","node-event-simulate" ]
},
}
}).use("my-module", "my-module-2", function(Y) {
//Now my-module, my-module-2 and all of their dependencies are loaded.
});
YUI.add("my-module-2", function(Y){
Y.MyModule2 = {
init:function() {
Y.log('my module 2 inited');
}
};
}, "0.1");
YUI.add("my-module", function(Y){
Y.MyModule = {
init:function() {
Y.log('my module inited');
}
};
}, "0.1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment