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
0 answers

Gulp4 watch is not following file changes

Here's my gulpfile.js contents: const fs = require( 'fs' ); const gulp = require( 'gulp' ); exports.watch = gulp.series( watch ); function watch() { const file = 'src/style.scss'; console.log( fs.readFileSync( file…
A.N.M. Saiful Islam
  • 2,118
  • 5
  • 28
  • 34
0
votes
1 answer

Convert into a valid Gulp 4 file

I am just working on an older project but I would like to make use of Gulp 4. I am looking to convert this into a valid Gulp 4 file. Would someone be able to assist or point me in the right direction. var gulp = require('gulp'); var browserify =…
Pianoc
  • 763
  • 1
  • 11
  • 32
0
votes
1 answer

Conditional execution of tasks

I am creating a Gulp plugin that requires conditional execution a tasks based on a condition generated from within the plugin. The current method I have implemented to achieve the conditional execution from what I understand is considered an…
panoply
  • 31
  • 1
  • 5
0
votes
0 answers

Gulp 4: "did you forget to signal async completion in watch task"

In my Gulpfile I have an issue, that I'll always get an error in the console: [22:33:32] The following tasks did not complete: default, watch, watch:views, watch:styles, watch:scripts [22:33:32] Did you forget to signal async completion? But, as…
Marcel Bührig
  • 105
  • 2
  • 11
0
votes
1 answer

Gulp 4 default task

I have the following gulpfile.js, which I'm executing via the command line "gulp": var conf = require('./config.json'); var gulp = require('gulp'); var pug = require('gulp-pug'); //var watch = require('gulp-watch'); function pug(){ return…
bala
  • 1
0
votes
1 answer

How to run function as a task in Gulp 4?

How to run a function during a Gulp execution so that Gulp treats the function as a task (prints it to the log)? Here is an example of my gulpfile.js: async function doStaff(todo) { // ... } exports.default = async () => { // Some asynchronous…
Finesse
  • 9,793
  • 7
  • 62
  • 92
0
votes
1 answer

Gulp watcher - call functions for single file

I have a function that I want to apply to only the changed file with gulp 4.0 watcher e.g. the current task would be: gulp.watch([ paths.sourceFolder + "/**/*.js", paths.sourceFolder + "/**/*.html", paths.sourceFolder + "/**/*.less", …
0
votes
1 answer

gulp 4 , how to get my gulpfile.js working?

I am sick trying to migrate to gulp 4, i wasted almost 2 days doing it.... I read about new functions API, about series, parallel. I did a clean uninstall of all previous packages and installed gulp 4 locally and gulp-cli globally. My console shows…
Anton
  • 516
  • 1
  • 6
  • 22
0
votes
1 answer

Signal async completion warning upon upgrade to Gulp 4

I use Gulp to run one simple task in a non-JavaScript project. I'm trying to upgrade from 3.9.1 to 4.0 to get rid of the flood of "deprecated" and "security" warnings. Together with articles like A quick guide for switching to gulp 4 I've upgraded…
Álvaro González
  • 142,137
  • 41
  • 261
  • 360
0
votes
1 answer

Gulp 4 task with node-mysql2 module causing server crash on connect

I have a need to run mysql queries within gulp to check certain fields in a table. I currently connect to a development server via ssh tunnel, which is opened via terminal so that my host is set to 'localhost'. When I execute a connection attempt,…
0
votes
1 answer

Gulp4 watch no reaction to changes

Migrating to Gulp 4 I encountered serious issues: no reaction to changes when using gulp.watch or gulp-watch. import gulp from 'gulp'; // import {get as browserSync} from 'browser-sync'; import watch from 'gulp-watch'; // const bs =…
CodeGust
  • 831
  • 3
  • 15
  • 36
0
votes
1 answer

gulp zip directories with different bases

I'm using gulp 4. I have the following file structure: ├── gulpfile.js ├── dir1 └── src ├── dir2 I want to zip dir1 and dir2 together in the same layer, i.e. not including src directory. How can I do it with gulp? One option I can think of is…
chepukha
  • 2,371
  • 3
  • 28
  • 40
0
votes
1 answer

Gulp clean task being called from other tasks

gulp.task('watch', gulp.series('clean', gulp.parallel('css')), gulp.watch(['./app/scss/**/*.scss'], gulp.series('clean', gulp.parallel('css'))) ); When using any other task in my gulpfile for some reason gulp.watch is being called. Does anyone…
Renari
  • 822
  • 7
  • 16
  • 32
0
votes
0 answers

How to properly install gulp v4.0.0-alpha.3 using npm?

I tried to install gulp version 4 alpha 3 by using: sudo npm install gulpjs/gulp#v4.0.0-alpha.3 -g And got the following errors: npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b 4.0 git://github.com/gulpjs/gulp.git…
khet
  • 95
  • 11
0
votes
1 answer

Use Visual Studio Code Tasks with Gulp 4.0

I am in the process of switching a project from Gulp 3.9.1 (npm install gulp) to Gulp 4.0 (npm install gulp-4.0.build), but when I do this, Visual Studio Code is no longer able to auto-detect the tasks in my gulpfile.js. In both cases, gulp is…
Andy G
  • 13
  • 4