Is it possible to use gulp with git sub-modules that have their own gulp settings and npm modules?
This is the idea:
/ Project
|- Modules
|-- Grid
|--- some files and subfolders
|--- gulpfile.js
|-- Typography
|--- some files and subfolders
|--- gulpfile.js
|
| gulpfile.js
Modules
are folder where I would like to keep unknown number of git sub-modules. Each of those git sub-modules would have their own gulpfile.js and NPM modules.
Question is - When I start gulp process from the root folder, is it possible for main gulpfile.js to start all other gulpfile.js files from included git sub-modules?
There's
gulp-hub
which let's you run gulpfiles in subfolders. When you rungulp foo
in your root folder it will run thefoo
task for each submodule.Since you need to pass it an array with the location of each submodule's gulpfile it's easiest to use the
glob
package in order to automatically find what submodules there are and which of them have gulpfiles (instead of hardcoding all of that).This is what your Project/gulpfile.js would look like:
Now when you run
gulp
in your root folder it will run thedefault
task for each submodule: