Created
July 30, 2009 18:05
-
-
Save lsmith/158818 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
// Step 1. Concat all module files you plan on using in your page into a | |
// personal rollup file. We'll call it bacon.js. | |
// At the end of bacon.js, add this line: | |
YUI.add('bacon', function (Y) {}, '@VERSION@',{ uses: ['list','of','the','concated','modules'] }); | |
// Step 2. Create a module config object to pass to the YUI constructor | |
var myModules = { | |
bacon: { | |
fullpath: 'https://path.to/bacon.js' | |
} | |
}; | |
// Step 3. Instantiate your YUI with your module config and use('bacon',...) | |
YUI({ modules: myModules }).use('bacon', function (Y) { | |
/* all rolled up modules are available and only one https request was made */ | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment