Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Gulp script with forever?

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.

like image 760
Boris Brdarić Avatar asked Feb 16 '15 14:02

Boris Brdarić


People also ask

What is gulp task runner?

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.

How to define a gulp task?

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).

What is gulp command?

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.


2 Answers

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.

like image 94
Theodore Yankov Avatar answered Oct 09 '22 01:10

Theodore Yankov


if you install gulp in your node project, you can do like this:

forever start node_modules/gulp/bin/gulp.js [YOUR GULP TASK]

like image 37
HaveF Avatar answered Oct 09 '22 02:10

HaveF