Invoking the Gulp tool programmatically
See original GitHub issueI am trying to invoke Gulp within another Node.js script. Is there any non-hackish way to do this? e.g. by not manually requiring bin/gulp.js
or setting up a new Liftoff({ ... })
, or running the command in the shell as is done at the moment in this plugin I’m currently working on?
To be more general I’m asking if there’s an official way to run Gulp as a part of another tool, without the extra overhead of spawning a new child process. A meta-API, if you like.
I think this is somewhat related to issue #755, except that no gulpfile
has been loaded yet.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:4
- Comments:34 (10 by maintainers)
Top Results From Across the Web
Run Gulp 4 task programmatically - node.js - Stack Overflow
Yes you can retrieve a task by calling gulp.task , but rather than calling it directly you can wrap it in a call...
Read more >Run Gulp 4 tasks programmatically from NodeJS
I want to use the power of the Gulp functions like the series(), parallel(), src(), dest(), pipe(), the globbing, an the plugin model...
Read more >Using Gulp — ASP.NET documentation
Gulp is a JavaScript-based streaming build toolkit that can be used for bundling and minification. Visual Studio automatically installs Gulp along with a...
Read more >An Introduction to Gulp.js - SitePoint
This article, sponsored by New Relic, provides an introduction to the automated task runner, Gulp.js, and shows how it can be used to ......
Read more >Learn How to Use Gulp - WebFX
In this tutorial, learn Gulp's most efficient tools on our site today! ... We can use this name in other Gulp tasks, or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nah heres how you really do it
a gulpfile is just a node script, so you can require it in like any other.
As they said though, .start will be gone in 4.0 and replaced with series and parallel
Ok, vanilla gulp
in gulp@4.0
gulp.start
will be removed in favor ofgulp.series
andgulp.parallel
, which are really cool by the way. So beware of changing that in the future.Using the plugin I wrote
which is the same as you wrote in the shell the task and pressed enter. The repl is something more of a feature. It can work without
stdin
andstdout
, but I have yet to document it better.Anyhow the first option will serve you good if your aim is simpler.