Skip to content

Instantly share code, notes, and snippets.

@ginpei
Created December 17, 2012 02:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ginpei/4315275 to your computer and use it in GitHub Desktop.
Save ginpei/4315275 to your computer and use it in GitHub Desktop.
`grunt.loadTasks('foo')` loads all JS files under directory `foo`, not `tasks/foo.js` with grunt v0.4.0rc2.
// ./Gruntfile.js
module.exports = function(grunt) {
grunt.loadTasks('hoge');
};
$ grunt hoge
`hoge/xxx.js` is loaded!
Running "hoge" task
Hello, hoge world!
Done, without errors.
// ./hoge/xxx.js
module.exports = function(grunt) {
console.log('`hoge/xxx.js` is loaded!');
grunt.registerTask('hoge', function() {
console.log('Hello, hoge world!');
});
};
@LC43
Copy link

LC43 commented Jul 15, 2018

+6 years, still works :)

@LC43
Copy link

LC43 commented Oct 12, 2019

you know, i needed to search for this again, and just noticed my own comment from last year...
7 years, going strong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment