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
2
votes
1 answer

How should I organize sub tasks in gulp 4?

I have a problem with subtasks when I using gulp 4. In gulp 3, I have splitted tasks into some files and use gulp-load-subtasks to load and execute them. When I using gulp 4, I got a problem when I try to load tasks. eg: I can't load task a (which…
WheelJS
  • 31
  • 6
2
votes
1 answer

Gulp 4 watch runs only 1 time

As I mentioned in the title there is a problem running gulp.watch. It runs watch only after first change in the file, when I changing second, third and etc it doesn't run task. Below is my gulpfile.js: var gulp = require('gulp'); var babel =…
lomboboo
  • 1,221
  • 1
  • 12
  • 27
1
vote
1 answer

How can I create a subfolder in each folder through Gulp?

Good day! I want to automate the conversion of images to webp format. To avoid doing it manually or via online converters, I decided to use gulp 4 and gulp-webp. This is the structure of nesting folders in my project: I want Gulp, when it finds a…
Alexei
  • 277
  • 1
  • 2
  • 9
1
vote
2 answers

Trouble with splitting gulpfile.js into multiple files in Gulp 4

I am a beginner to Javascript and Gulp. Am learning this based on a udemy course in which Gulp 3 is being used, and I've been looking at docs to convert the code to Gulp 4. It's been fun so far since I am learning more when I am doing the…
manuviswan
  • 21
  • 4
1
vote
2 answers

Can't install gulp globally

I can't install gulp globally on my windows 7 machine. I used npm install --global gulp-cli but showed this error: when i used gulp -v I got this error please help
1
vote
2 answers

Visual Studio 2019 Task Runner Explorer + Gulp 4

I have to migrate a frontend build process from Gulp 3.9.1 to Gulp 4.0.2. The latest Gulp doc says here that a gulpfile can be splitted in various parts placed under a folder named gulpfile.js with an index.js file and all other scripts. Does Visual…
sblandin
  • 904
  • 4
  • 11
  • 25
1
vote
1 answer

Gulp 4 ReferenceError: merge is not defined

In VS 2019 when I try to Publish to a folder Gulp fails with ReferenceError: merge is not defined. gulpfile.js /// var gulp = require('gulp'); var uglify = require("gulp-uglify"); var concat =…
Joe
  • 4,143
  • 8
  • 37
  • 65
1
vote
1 answer

Automatic append of src folder when injecting the files in temp folder

I am currently migrating gulp 3.x to gulp 4.x, In this gulp html file creates a temp folder. In this there is an automatic update of src/ folder getting appended. Expected result .tmp/serve Inside serve following file structure need to be…
Ragini
  • 13
  • 3
1
vote
1 answer

Gulp function with value "sass('floder1')"

I am trying to use same gulpfile.js for multiple projects. Let's say I want to use same sass() function for two different project. I have tried passing value like javascript sass(x){.... .src(x+"/src/style/scss/*.scss")}. But it didnt work. Is there…
Zaman
  • 71
  • 2
  • 6
1
vote
1 answer

Gulp 3.9 to 4 Migration

I know this has been asked many times before, but none of the answers helped me to solve my problem migrating gulp 3 to 4. We didn't necessarily have to upgrade to version 4 of gulp, but updating Node.js from 10 to 12 forced us to do so, since…
ashilon
  • 1,791
  • 3
  • 24
  • 41
1
vote
4 answers

How can I use old style task names with the new gulp task api?

According to https://gulpjs.com/docs/en/api/task the new way to create tasks is not gulp.task("xyz" ...) but instead use exports.build = build; The problem with this approach is, that I can't use old task names like feature:build, feature:watch…
totkeks
  • 89
  • 2
  • 9
1
vote
1 answer

How can I migrate Gulp3 to Gulp4 (gulpfile.js)?

Im having problems to update my gulpfile.js from GULP3 to GULP4 I tried to update with gulp.series() and gulp.parallel() My Gulpfile is like this : var gulp = require('gulp') var browserSync = require('browser-sync').create() gulp.task('serve',…
1
vote
3 answers

how to add browser-sync in gulp-4

//Importing gulp files to variables const { src , dest , watch , series , parallel } = require('gulp'); const autoprefixer = require('autoprefixer'); const cssnano = require('cssnano'); const concat = require('gulp-concat'); …
Pooria m
  • 11
  • 4
1
vote
1 answer

Light Gulp 4 task still throwing 'async completion' error

I've not used Gulp before, so I'm not migrating an old gulpfile to Gulp 4. I'm just trying to get a few basic tasks set up. However, regardless of the method I use to signal async completion as well documented in this post I still get the "Did you…
webermn15
  • 25
  • 3
1
vote
1 answer

How do I group tasks?

I'm experimenting with gulp 4 and I have a couple of tasks(buildIndex, buildContent, buildStyling and buildScripts) that insert files in the build folder. I'd like to group those tasks into one task, so I can execute the group at the top-level. This…
Janneman96
  • 374
  • 1
  • 8
  • 24