Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run gulp with an arbitrary gulpfile name (not gulpfile.js)

I have one specific task in my gulpfile that is isolated from the other tasks and never needs to run as part of the rest of the build process. I'd like to put it in a separate gulpfile and execute that on its own.

How can I use gulp with a gulpfile that has a custom name?

The Getting started document posing as Gulp's docs don't seem to mention the CLI. My search attempts for arguments to the gulp, mostly brings up results on how to get the command line arguments into the gulp tasks.

The actual use case is extracting translatable strings in a Docker container, which I don't want to bloat with unnecessary node.js packages.

like image 401
Dag Høidahl Avatar asked Dec 04 '15 23:12

Dag Høidahl


People also ask

What is gulp Gulpfile?

Gulpfile explained A gulpfile is a file in your project directory titled gulpfile. js (or capitalized as Gulpfile. js , like Makefile), that automatically loads when you run the gulp command.

How do I run Gulpfile in Visual Studio?

Run a Gulp Task in Visual Studio CodeType "Run Task" and select it, which will bring up a list of tasks configured in Gulp. Choose the Gulp Task you want to run! Most of your Gulp Tasks will probably be automated using gulp watch, but manual Gulp Tasks can easily be run within Visual Studio Code.


1 Answers

Here is what the gulp CLI docs say:

--gulpfile <gulpfile path> will manually set path of gulpfile. Useful if you have multiple gulpfiles. This will set the CWD to the gulpfile directory as well

like image 65
Dag Høidahl Avatar answered Oct 15 '22 18:10

Dag Høidahl