在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):juanfran/gulp-multi-process开源软件地址(OpenSource Url):https://github.com/juanfran/gulp-multi-process开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-multi-process
Installnpm install gulp-multi-process --save-dev UsageGulp 3
var gulp = require('gulp');
var gulpMultiProcess = require('gulp-multi-process');
gulp.task('task1', function(cb) {
// example
});
gulp.task('task2', function(cb) {
// example
});
gulp.task('multi', function(cb) {
// task1 and task2 will run in different processes
return gulpMultiProcess(['task1', 'task2'], cb);
}); Gulp 4
const gulp = require('gulp');
const gulpMultiProcess = require('gulp-multi-process');
function task1() {
// example
});
exports.task1 = task1;
function task2() {
// example
});
exports.task2 = task2;
// gulp single will run task1 and task2 on a serial way
exports.single = gulp.series(task1, task2)
function multi(done) {
// task1 and task2 will run in different processes
return gulpMultiProcess(['task1', 'task2'], done);
}
exports.multi = multi; WarningRun task in multiple processes is not always good for performance because spawn a different node processes is slow. It also depends on how long time it takes to require your |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论