Perhaps it's something wrong with my approach but I have a following situation:
- I have a
component-a
that has a gulpfile. One of its tasks (eg. build) builds the component and creates a combined js file in dist folder - I have a
component-b
that has a gulpfile. One of its tasks (eg. build) builds the component and creates a combined js file in dist folder - I have a project that uses both components. This project has a gulpfile as well and in it I would like to write a task that:
- executes build task from /components/component-a/gulpfile.js
- executes build task from /components/component-b/gulpfile.js
- concats /components/component-a/dist/build.js and /components/component-b/dist/build.js (I know how to do this)
What I don't know is how to execute the build task from /components/component-?/gulpfile.js. Is it even possible or I should deal with this situation otherwise?
require('child_process').spawn;
Running a Gulpfile from a different directory is quite simple with Node's
child_process#spawn
module.Try adapting the following to your needs:
gulp-chug
Although using
gulp-chug
is one way to go about this, it has been blacklisted bygulp
's maintainers for being...The official blacklist states...