Is it possible to run Gulp script with forever?
I have Gulp script that would like to run as a daemon, so I could start / stop / list it.
Gulp is a task runner that uses Node. js as a platform. It purely uses the JavaScript code and helps to run front-end tasks and large-scale web applications. Gulp builds system automated tasks like CSS and HTML minification, concatenating library files, and compiling the SASS files.
Each gulp task is an asynchronous JavaScript function - a function that accepts an error-first callback or returns a stream, promise, event emitter, child process, or observable (more on that later).
Gulp is a tool that helps you out with several tasks when it comes to web development. It's often used to do front end tasks like: Spinning up a web server. Reloading the browser automatically whenever a file is saved.
Okay, so I solved it by linking the gulp binary from /usr/bin to my local folder and then simply running the command locally. Like so:
ln -s /usr/bin/gulp ./gulp
forever start gulp serve
The commands may vary for you but I hope you get the gist of it.
if you install gulp
in your node project, you can do like this:
forever start node_modules/gulp/bin/gulp.js [YOUR GULP TASK]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With