Skip to content

Commit

Permalink
Merge pull request #1675 from STRML/remove-coffeescript
Browse files Browse the repository at this point in the history
Remove coffeescript from dependencies.
  • Loading branch information
vladikoff committed Jun 29, 2020
2 parents 58f80ae + ba492b6 commit 5f16b5a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
20 changes: 19 additions & 1 deletion lib/grunt.js
Expand Up @@ -4,7 +4,25 @@
var path = require('path');

// This allows grunt to require() .coffee files.
require('coffeescript/register');
try {
// Note: grunt no longer depends on CoffeeScript, it will only use it if it is intentionally
// installed in the project.
require('coffeescript/register');
} catch (e) {
// This is fine, and will cause no problems so long as the user doesn't load .coffee files.
// Print a useful error if we attempt to load a .coffee file.
if (require.extensions) {
var FILE_EXTENSIONS = ['.coffee', '.litcoffee', '.coffee.md'];
for (var i = 0; i < FILE_EXTENSIONS.length; i++) {
require.extensions[FILE_EXTENSIONS[i]] = function() {
throw new Error(
'Grunt attempted to load a .coffee file but CoffeeScript was not installed.\n' +
'Please run `npm install --dev coffeescript` to enable loading CoffeeScript.'
);
};
}
}
}

// The module to be exported.
var grunt = module.exports = {};
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -37,7 +37,6 @@
"tool"
],
"dependencies": {
"coffeescript": "~1.10.0",
"dateformat": "~1.0.12",
"eventemitter2": "~0.4.13",
"exit": "~0.1.1",
Expand Down

0 comments on commit 5f16b5a

Please sign in to comment.