Search code examples
javascriptnode.jsdockergulpcommand-line-interface

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.


Solution

  • 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