Skip to content

Commit

Permalink
[refactor] Don't touch require.extensions
Browse files Browse the repository at this point in the history
`require.extensions` support in CoffeeScript was introduced in
jashkenas/coffeescript@ba85079, we no
longer need to manipulate it on our own.
  • Loading branch information
mmalecki committed Jun 17, 2012
1 parent 6aa9673 commit 3e60864
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,12 @@ var path = require('path'),

//
// Attempt to load Coffee-Script. If it's not available, continue on our
// merry way, if it is available, set it up so we can include `*.coffee`
// scripts and start searching for them.
// merry way, if it is available, start searching for `*.coffee` scripts too.
//
var fileExt, specFileExt;

try {
var coffee = require('coffee-script');
if (require.extensions) {
require.extensions['.coffee'] = function (module, filename) {
var content = coffee.compile(fs.readFileSync(filename, 'utf8'));
return module._compile(content, filename);
};
} else {
require.registerExtension('.coffee', function (content) { return coffee.compile(content) });
}
fileExt = /\.(js|coffee)$/;
specFileExt = /[.(-|_)](test|spec)\.(js|coffee)$/;
} catch (_) {
Expand Down

0 comments on commit 3e60864

Please sign in to comment.