Skip to content

Instantly share code, notes, and snippets.

@unscriptable
Created July 17, 2012 20:26
Show Gist options
  • Save unscriptable/3131823 to your computer and use it in GitHub Desktop.
Save unscriptable/3131823 to your computer and use it in GitHub Desktop.
how to local-require
define(function (require, exports, module) {
return {
component: { module: './something' },
$module: module // has absolute id of spec (as well as other future goodies)
};
});
define(function (require) {
return {
component: { module: require('./something') }
};
});
define(function (require) {
return {
component: { module: './something' },
$require: require
};
});
define({
component: { require: './something' },
plugins: [
{ module: 'wire/amd' } // adds require factory
]
});
define({
component: { module: './something' },
plugins: [
{ module: 'wire/curl' } // could this somehow take over the module factory?
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment