Questions tagged [gulp-4]

use this tag for specific issues about Gulp version 4 or upgrading to version 4; use the [gulp] tag for general gulp issues

Gulp version 4

gulp is a toolkit that helps you automate painful or time-consuming tasks in your development workflow.

Github project: https://github.com/gulpjs/gulp/tree/4.0

Upgrade instructions: https://codeburst.io/switching-to-gulp-4-0-271ae63530c0

Guide to Upgrading to Gulp 4: https://www.joezimjs.com/javascript/complete-guide-upgrading-gulp-4/

115 questions
0
votes
1 answer

Migrated from Gulp3.9.1 to Gulp 4, NodeMon server/process restarts in loop

I migrated gulp from 3.9.1 to Gulp 4.0.2. Converted all the task as per Gulp 4 guidelines, however when I run 'gulp' from command line, all the tasks until 'nodemon' starts and finishes, but when it is about to start 'nodemon', it tries to start and…
Amol Aranke
  • 523
  • 5
  • 8
0
votes
0 answers

Did the gulp series function not work for async method?

I Tried to run below gulp script in gulp4 but it is worked in gulp3. gulp.task('task2', gulp.series('task1', async function () { await new Promise((resolve) => { gulp.src('/folder/file.md') …
Mister X
  • 3,406
  • 3
  • 31
  • 72
0
votes
0 answers

Problems with splitting gulpfile.js into multiple files

I'm trying to split my gulpfile.js to multiply files (due to the amount of tasks). My files structure looks like this: ./ - gulpfile.js/ - index.js - tasks/ - cleanup.js - main.js index.js: const requireDir =…
Dom
  • 3,126
  • 14
  • 46
  • 68
0
votes
1 answer

In Gulp 4 should I now use .series() instead of .pipe()?

In gulp version 4 should I now use series() instead of pipe()? For example; my v3 task is below, should I change it to the last bit of code I've pasted? Is that the new gulp v4 way of doing things? gulp.task('mytask', function() { return…
sazr
  • 24,984
  • 66
  • 194
  • 362
0
votes
1 answer

Gulp 4 array as source

I'm attempting to upgrade to Gulp 4 in an existing project. I have created a task called vendor with the intent of concatenating and minifying global javascript packages. Unfortunately I'm receiving an error when compiling with the following…
Hughes
  • 985
  • 2
  • 9
  • 29
0
votes
1 answer

Task does not stop in Gulp

I can't figure out why a task in Gulp starts but doesn't end automatically The task code is as follows: import del from 'del'; import { projectFolder } from '../config'; const cleanRoot = () => { return del(projectFolder); }; export default…
SineYlo
  • 85
  • 1
  • 1
  • 4
0
votes
0 answers

Execute gulp4 task on cordova hook

Recently I upgraded to nodejs 12, that required me to upgrade to gulp4. The upgrade was a must so I cannot downgrade. Now, my cordova hook does not execute the gulp task. Previously I executed it as: gulp.start('build'); Now, gulp.start is no…
Andrew
  • 6,808
  • 3
  • 18
  • 33
0
votes
1 answer

Returning a stream but still getting error "Did you forget async completion?" Gulp 4

I am building a website on gulp, this code snippet basically contains 3 tasks browser-sync jekyll-build stylus, browser-sync task depends upon jekyll-build. browser-sync works fine but the stylus function in which I am returning a stream is giving a…
0
votes
1 answer

GulpJS 4.0.2 series inside a function called by a series does not work

I have a problem with this code as the second function is never called: // gulpfile.js const {series} = require('gulp'); function second(cb){ console.log('second function'); cb(); } function first(cb) { console.log('first function'); …
gabrielgeo
  • 507
  • 2
  • 6
  • 17
0
votes
1 answer

Why do I need Gulp 4 exports + what do I push to Github repo using Gulp 4

everyone. I have been learning Gulp 4 so far and I have two questions about it: When I was reading articles about Gulp 4, I saw that functions are exported (usually at the bottom of gulpfile.js file). For instance, exports.style = style. I would…
0
votes
1 answer

Gulp 4 running in development mode

I changed Gulp3 into Gulp4. In my gulpfile.js I created a task: if I am doing a modification, I can see it immediately in the development mode, without building my website: gulp.task('serve-php', function () { connect.server({ port: 9001, …
Camille BOUQUET
  • 445
  • 1
  • 6
  • 18
0
votes
1 answer

Trying to start server with Gulp and it throw error

I'm trying to run sever and I get this assertion error. I've uninstalled node and NPM and reinstalled again also I tried many steps and suggested solutions here but it doesn't fit with my problem. AssertionError [ERR_ASSERTION]: Task never defined:…
Alaa El Saedy
  • 368
  • 3
  • 13
0
votes
1 answer

Typescript, @types/gulp gulp 4, browser-sync

Need help setting up this ts-project. Thanks in advance. There might be similar questions here but I could not find gulpfile.ts solution yet. //- package.json { "name": "cdd", "version": "1.0.0", "description": "", "main":…
vssadineni
  • 454
  • 4
  • 11
0
votes
1 answer

Create a for loop for several file names in a Gulp.js 4 function

I'm currently trying to use one single svg sprite per page, so that it only loads the necessary svg's for each separate page. Is currently working, but I want to create an array so that the task get's called for N pages that I want. I currently…
Leo
  • 956
  • 8
  • 24
0
votes
1 answer

Gulp.series with same source file not working (Async tasks were not awaited)

I have a few gulp tasks which use plop.js to modify a certain file. If I run the tasks by themselves they work just fine. Now I have a wrapper tasks, where I prompt the user which of the tasks he wants to execute and then I would like to use…
Merc
  • 4,241
  • 8
  • 52
  • 81