Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove coffeescript from dependencies. #1675

Merged
merged 1 commit into from Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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