GruntLauncher
GruntLauncher copied to clipboard
How can I run external gulp tasks?
Suppose I have a file called foo.js
which contains a task called bar
. This task is not defined in my main gulp file, as its a common task shared among projects. In my gulpfile.js
I'll include it the normal way:
require("./path/to/other/gulp/files/foo.js");
I can run this the normal way: gulp bar
.
But the extension won't recognise it, and doesn't show it.
Currently the plugin parses your gruntfile to identify defined grunt tasks but won't parse external files.
I can try to do the same thing I did for grunt: rely on executing directly grunt to identify defined tasks whenever the gulpfile directly references another js file.
To be precise you usually require other gulpfiles by relative path ?
@Bjornej Yes that seems to be how it works for me. If I use that require
command as above, gulp will recognise any tasks defined in there, and I can just execute them on the command line.
Ok, then I'll modify the plugin to use gulp from the command line to identify the available tasks whenever a require with a relative path is found.
To do this I'll need a stronger cache on results but it shouldn't be a problem