不要怂,就是干,撸起袖子干!

Commit f582100a by Rob Skillington

Fix for CoffeeScript prior to breaking change in 1.7.x for compiler registration

1 parent a9dbf12f
Showing with 6 additions and 0 deletions
...@@ -52,12 +52,18 @@ module.exports = (function() { ...@@ -52,12 +52,18 @@ module.exports = (function() {
get: function() { get: function() {
if (this.path.match(/\.coffee$/)) { if (this.path.match(/\.coffee$/)) {
try { try {
// 1.7.x compiler registration
require('coffee-script/register') require('coffee-script/register')
} catch(e) { } catch(e) {
try {
// Prior to 1.7.x compiler registration
require('coffee-script')
} catch (e) {
console.log("You have to add \"coffee-script\" to your package.json.") console.log("You have to add \"coffee-script\" to your package.json.")
process.exit(1) process.exit(1)
} }
} }
}
return require(this.path) return require(this.path)
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!