Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lsmith/158818 to your computer and use it in GitHub Desktop.
Save lsmith/158818 to your computer and use it in GitHub Desktop.
// 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