-
Install
npm install --save-dev gulp-runtime
-
Open a
gulpfile
, or create one, and
change this line
var gulp = require('gulp');
with
var gulp = require('gulp-runtime').create();
After that run the gulpfile
with node
directly from the command line
node gulpfile.js default watch serve
Thats it! When no arguments are given the default
task will run instead.
- What about the CLI? Can I just run
gulp-runtime
from the terminal?
Yes. For this add an alias to your .bashrc
or .zshrc
alias gulp-runtime='node $(find . -name "gulpfile.js" -not -path "./node_modules/*" | head -n1)'
which will use the first gulpfile.js
found in the current working directory excluding node_modules
.
Right after this open a new terminal tab and write
gulp-runtime --tasks default watch serve