Skip to content

Commit

Permalink
support .cjs extension
Browse files Browse the repository at this point in the history
  • Loading branch information
justlep committed Oct 15, 2021
1 parent ee722d1 commit e35fe54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grunt/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ function loadTasksMessage(info) {
// Load tasks and handlers from a given directory.
function loadTasks(tasksdir) {
try {
var files = grunt.file.glob.sync('*.{js,coffee}', {cwd: tasksdir, maxDepth: 1});
var files = grunt.file.glob.sync('*.{js,cjs,coffee}', {cwd: tasksdir, maxDepth: 1});
// Load tasks from files.
files.forEach(function(filename) {
loadTask(path.join(tasksdir, filename));
Expand Down Expand Up @@ -434,7 +434,7 @@ task.init = function(tasks, options) {
gruntfile = null;
} else {
gruntfile = grunt.option('gruntfile') ||
grunt.file.findup('Gruntfile.{js,coffee}', {nocase: true});
grunt.file.findup('Gruntfile.{js,cjs,coffee}', {nocase: true});
msg = 'Reading "' + (gruntfile ? path.basename(gruntfile) : '???') + '" Gruntfile...';
}

Expand Down

0 comments on commit e35fe54

Please # to comment.