diff --git a/lib/coffee-script.js b/lib/coffee-script.js index 8523aad3..95d31302 100755 --- a/lib/coffee-script.js +++ b/lib/coffee-script.js @@ -45,7 +45,7 @@ if (root.moduleCache) { root.moduleCache = {}; } - return root._compile(exports.compile(code, options), root.filename); + return path.extname(root.filename) !== '.coffee' || require.extensions ? root._compile(exports.compile(code, options), root.filename) : root._compile(code, root.filename); }; exports.eval = function(code, options) { var __dirname, __filename;