Skip to content

Commit

Permalink
Merge pull request #1736 from justlep/main
Browse files Browse the repository at this point in the history
support .cjs extension
  • Loading branch information
vladikoff authored Oct 15, 2021
2 parents ee722d1 + e35fe54 commit fdc7056
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 fdc7056

Please sign in to comment.