简体   繁体   中英

Gulp - require gulpfile from node.js and pass task data

I'm trying to run gulpfile from another node.js file

const gulp = require('gulp');
require('coffee-script/register');
require('../gulpfile');

and execute it like:

node ./bin/runGulp.js serve --foo bar

Unfortunately it doesn't start this task.

You should run gulp with gulp command instead of node .

Try

gulp --gulpfile bin/rungGulp.js server --foo bar

More: Github issue and gulp cli docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM