Skip to content

Instantly share code, notes, and snippets.

@mockee
Created September 12, 2012 17:13
Show Gist options
  • Save mockee/3708247 to your computer and use it in GitHub Desktop.
Save mockee/3708247 to your computer and use it in GitHub Desktop.
Using `define.js` with `Do.js`
// Using new `define.js`
// https://gist.github.com/3699759
// Set namespace & module exports aliases
define.ns('Ark');
define.config({
'mods/cookie': 'Ark.cookie',
'mods/ajax': 'Ark.ajax'
});
// Development
Do.add('cookie', { path: 'mods/cookie.js' });
Do.add('ajax', { path: 'mods/ajax.js', requires: ['cookie'] });
// Production
Do.add('ajax', { path: 'mods/ajax-with-cookie.js' });
Do('ajax');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment