How to run gulp tasks from a node script

喜你入骨 提交于 2019-12-04 09:54:37

问题


I have a node script and I want to run a gulp task I have in the same script, how can I call it?

#!/usr/bin/env node
var gulp = require('gulp');
gulp.task('default', function (arg) {

});

// How do I call the task 'default'

回答1:


Eventually I found the way:

gulp.start('default');



回答2:


Use an array in start method, in the case someone is looking for a way of running multiple tasks from search engines.

gulp.start( [ 'task1', 'task2' ] );


来源:https://stackoverflow.com/questions/28481020/how-to-run-gulp-tasks-from-a-node-script

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!