How to use the parallel function from gulp

Find comprehensive JavaScript gulp.parallel code examples handpicked from public code repositorys.

93
94
95
96
97
98
const jsState1 = gulp.series(jsLint);
const jsState3 = gulp.parallel(jsLibs, jsApp, jsAdmin);
const jsState2 = gulp.series(jsClean, webpack, jsState3, jsMin);

exports.jsLint = jsLint;
exports.js = gulp.parallel(jsState1, jsState2);
fork icon825
star icon0
watch icon161

+ 31 other calls in file

260
261
262
263
264
265
266
267
268
269
const dir = 'plugins';
const folders = fs.readdirSync(dir).filter(function(file) {
  return fs.statSync(path.join(dir, file)).isDirectory() &&
      fs.existsSync(path.join(dir, file, 'package.json'));
});
return gulp.parallel(folders.map(function(folder) {
  return function preDeployPlugin() {
    return preparePlugin(folder);
  };
}))(done);
fork icon468
star icon632
watch icon0

+ 4 other calls in file

28
29
30
31
32
33
gulp.task('open', function() {
  gulp.src('index.html')
    .pipe(open());
});

gulp.task('open-app', gulp.parallel('open', 'watch'));
fork icon449
star icon0
watch icon45

+ 3 other calls in file

78
79
80
81
82
83
exports.css = css;
exports.js = javascript;
exports.images = images;
exports.webpVersion = webpVersion;
exports.avifVersion = avifVersion;
exports.dev = parallel(images, webpVersion, avifVersion, javascript, dev);
fork icon0
star icon1
watch icon0

375
376
377
378
379
380
381
382
383
384
385
386
gulp.task('format:eslint', callback => runEslint(true, callback));
gulp.task('format', gulp.series('format:prettier', 'format:eslint'));


gulp.task('lint:prettier', callback => runPrettier(false, false, callback));
gulp.task('lint:eslint', callback => runEslint(false, callback));
gulp.task('lint', gulp.parallel('lint:prettier', 'lint:eslint'));


/**
 * Run a command in the terminal using exec, and wrap it in a promise
 * @param {string} cmd The command line command + args to execute
fork icon238
star icon0
watch icon35

+ 2 other calls in file

189
190
191
192
193
194
195
196
197
198
199
200
});


gulp.task('compile-webextension', async () => {
    await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.web.config.js');
});
gulp.task('compile-webviews', gulp.parallel('compile-viewers', 'compile-renderers', 'compile-webextension'));


/**
 * On CI we download the binaries from gitbhub.
 * Sometimes there can be too many requests and we get a 403.
fork icon209
star icon956
watch icon43

+ 24 other calls in file

285
286
287
288
289
290
291
292
  }
}


gulp.task("build", gulp.series("copy-terriajs-assets", "build-app"));
gulp.task("release", gulp.series("copy-terriajs-assets", "release-app"));
gulp.task("watch", gulp.parallel("watch-terriajs-assets", "watch-app"));
gulp.task("default", gulp.series("lint", "build"));
fork icon0
star icon1
watch icon1

+ 11 other calls in file

930
931
932
933
934
935
936
937
938
939
940
941
exports.build = gulp.series.apply(undefined, [
  ...(NO_VERIFICATION ? [] : [verifications]),
  clean,


  // thumbs
  gulp.parallel(thumbsPreview, thumbsSizes),


  // kits
  gulp.parallel.apply(undefined, [
    kitsData,
fork icon74
star icon254
watch icon28

+ 5 other calls in file

433
434
435
436
437
438
439
440
441
}

// These are the steps that always run for every build
// If set_dev is called, some of these methods behave differently
steps = steps.concat([
  gulp.parallel(js, images, manifests, fonts, css),
  jekyll,
  styles,
]);
fork icon538
star icon177
watch icon94

99
100
101
102
103
104
105
106
107
108
109
110
if (typeof module !== 'undefined' && module.exports) { module.exports = components; }`;
	return util.promisify(fs.writeFile)(paths.componentsFileJS, js);
}


function watchComponentsAndPlugins() {
	watch(paths.components, parallel(minifyComponents, build));
	watch(paths.plugins, parallel(minifyPlugins, build));
}


async function languagePlugins() {
fork icon0
star icon1
watch icon2

+ 3 other calls in file

184
185
186
187
188
189
190
191
192
193
194
195
      .pipe(gulp.dest(dist)),
  );
});


// Build all tasks
gulp.task('js', gulp.parallel(...tasks.js));
gulp.task('css', gulp.parallel(...tasks.css));
gulp.task('sprites', gulp.parallel(...tasks.sprite));


// Watch for file changes
fork icon0
star icon0
watch icon1

+ 11 other calls in file

30
31
32
33
34
35
36
37
38
39
40
gulp.task('unittest', unittestTask);
gulp.task('test', gulp.parallel('lint', 'unittest'));
gulp.task('library-size', librarySizeTask);
gulp.task('module-sizes', moduleSizesTask);
gulp.task('size', gulp.parallel('library-size', 'module-sizes'));
gulp.task('default', gulp.parallel('build'));


function run(bin, args, done) {
  return new Promise(function(resolve, reject) {
    var exe = '"' + process.execPath + '"';
fork icon0
star icon0
watch icon1

+ 7 other calls in file

125
126
127
128
129
130
131
132
133
134
135
136
  }
})


gulp.task('build', gulp.series(
  'clean',
  gulp.parallel('build:scripts', 'build:styles'),
  ...(skipStandalone ? [] : ['build:standalone'])
))


gulp.task('default', gulp.parallel('build'))
fork icon0
star icon0
watch icon1

89
90
91
92
93
94
95
exports.watching = watching
exports.images = images
exports.cleanDist = cleanDist
exports.build = series(cleanDist, images, build)


exports.default = parallel(styles, scripts, browsersync, watching)
fork icon0
star icon0
watch icon1

420
421
422
423
424
425
426
427
428
429
430
431
432
	});
}


const execGit = gulp.series(gitAdd, gitCommit, gitTag);


const execBuild = gulp.parallel(buildTS, buildLess, buildSASS, copyFiles);


exports.build = gulp.series(clean, execBuild);
exports.watch = buildWatch;
exports.clean = clean;
fork icon0
star icon0
watch icon1

+ 2 other calls in file

124
125
126
127
128
129
130
131
132
133
134
135
        .pipe(eslint())
        .pipe(eslint.format())
        .pipe(eslint.failAfterError());
});


gulp.task('lint', gulp.parallel('lint-js', 'lint-ts'));


gulp.task('build',
    gulp.series(
        'clean-lib',
fork icon0
star icon0
watch icon1

+ 5 other calls in file

133
134
135
136
137
138
139
140
141
142
gulp.task('build:example:style', buildExampleStyle);
gulp.task('build:example:html', buildExampleHTML);

gulp.task('build:example', gulp.parallel('build:example:assets', 'build:example:style', 'build:example:html'));

gulp.task('build', gulp.parallel('build:style', 'build:example'));

gulp.task('tag', () => new Promise((resolve) => {
  const tag = `v${pkg.version}`;
  exec(`git tag ${tag}`).then(resolve);
fork icon0
star icon0
watch icon0

+ 31 other calls in file

139
140
141
142
143
144
145
146
147
148
/**
 * Default Build operation
 */
exports.default = gulp.series(
	pdel([DIST])
	, gulp.parallel(
		buildSource()
		, buildManifest()
		, outputLanguages()
		, outputTemplates()
fork icon0
star icon0
watch icon1

+ 2 other calls in file

197
198
199
200
201
202
203
204
205
206
207
    gulp.watch([path.watch.js], gulp.parallel(dev, js));
    gulp.watch([path.watch.img], gulp.parallel(dev, img));
    gulp.watch([path.watch.fonts], gulp.parallel(dev, fonts));
}


exports.build = gulp.parallel(build, html, css, js, img, fonts);
exports.dev = gulp.parallel(dev, html, css, js, img, fonts);


gulp.task('default', gulp.series(dev, html, css, js, img, fonts, gulp.parallel(webserver, watch)));
fork icon0
star icon0
watch icon1

316
317
318
319
320
321
322
323
324
325
 *     python_compressed.js
 *     php_compressed.js
 *     lua_compressed.js
 *     dart_compressed.js
 */
const buildGenerators = gulp.parallel(
  buildJavascript,
  buildPython,
  buildPHP,
  buildLua,
fork icon0
star icon0
watch icon1

+ 5 other calls in file