Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created March 11, 2010 06:14
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 tim-smart/328894 to your computer and use it in GitHub Desktop.
Save tim-smart/328894 to your computer and use it in GitHub Desktop.
// This returns a Javascript string
require.registerExtension('.coffee', function(async, source, callback) {
return compileCoffee(source);
});
// True
require('coffee').test === 123;
// This returns a object
require.registerExtension('.mu', function(async, source, callback) {
return function () {};
});
// True
typeof require('template') === 'function';
exports.test: 123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment