Skip to content

Commit

Permalink
use 'coffeescript' package
Browse files Browse the repository at this point in the history
  • Loading branch information
odedniv committed Jan 16, 2018
1 parent 18c5d0e commit 1250667
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
13 changes: 11 additions & 2 deletions lib/moduleEnv.js
Expand Up @@ -89,6 +89,10 @@ function jsExtension(module, filename) {
}

function coffeeExtension(module, filename) {
if (!coffee) {
throw new Error("please add 'coffeescript' to your devDependencies");
}

var content = stripBOM(fs.readFileSync(filename, "utf8"));

restoreExtensions();
Expand All @@ -113,9 +117,14 @@ function stripBOM(content) {
}

try {
coffee = require("coffee-script");
coffee = require("coffeescript");
} catch (err) {
// We are not able to provide coffee-script support, but that's ok as long as the user doesn't want it.
try {
// Trying to load deprecated package
coffee = require("coffee-script");
} catch (err) {
// We are not able to provide coffee-script support, but that's ok as long as the user doesn't want it.
}
}

exports.load = load;
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -30,7 +30,7 @@
"url": "git://github.com/jhnns/rewire.git"
},
"devDependencies": {
"coffee-script": "^1.8.0",
"coffeescript": "^2.1.1",
"expect.js": "^0.3.1",
"mocha": "^4.0.1"
},
Expand Down

0 comments on commit 1250667

Please sign in to comment.