Skip to content

Commit e35fe54

Browse files
committed
support .cjs extension
1 parent ee722d1 commit e35fe54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/grunt/task.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ function loadTasksMessage(info) {
345345
// Load tasks and handlers from a given directory.
346346
function loadTasks(tasksdir) {
347347
try {
348-
var files = grunt.file.glob.sync('*.{js,coffee}', {cwd: tasksdir, maxDepth: 1});
348+
var files = grunt.file.glob.sync('*.{js,cjs,coffee}', {cwd: tasksdir, maxDepth: 1});
349349
// Load tasks from files.
350350
files.forEach(function(filename) {
351351
loadTask(path.join(tasksdir, filename));
@@ -434,7 +434,7 @@ task.init = function(tasks, options) {
434434
gruntfile = null;
435435
} else {
436436
gruntfile = grunt.option('gruntfile') ||
437-
grunt.file.findup('Gruntfile.{js,coffee}', {nocase: true});
437+
grunt.file.findup('Gruntfile.{js,cjs,coffee}', {nocase: true});
438438
msg = 'Reading "' + (gruntfile ? path.basename(gruntfile) : '???') + '" Gruntfile...';
439439
}
440440

0 commit comments

Comments
 (0)