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
1
vote
1 answer

Is it possible to get filename in gulp4 gulp.watch Task?

For example let's say i have this listener: gulp.watch('../templates/**/*.tpl', gulp.series('template')); and the associated task: var template = gulp.task('template', function(done) { console.log(filename); done(); }); Is it possible to…
FFirmenich
  • 5,611
  • 1
  • 19
  • 28
1
vote
1 answer

Browsersync doesn't inject css

In my one project I use Gulp and Browsersync. It's working well. I copied the gulpfile.js to my new project and replaced paths. Browsersync doesn't inject css now. This problem I see every time I create new project with the same gulpfile.js I used…
1
vote
1 answer

How to create a gulp file with reusable functions - Multiple Watch points & Multiple Output destinations

Goal is to use this Gulp file to execute 'n' number of different source & destinations. How can we pass the arguments(source, destination) so that the CSS-Generator task is accepting those source & destinations and giving out the separate output…
TheLearner
  • 13
  • 2
1
vote
0 answers

Gulp v.4 CSS Inject Using BrowserSync not Working

I have a local server setup using Valet +. I have gulp v.4 setup with a gulpfile.js (see below) and I am trying to perform a watch function which creates a css inject as a default task. The sass compiling task works when the watch task triggers a…
1
vote
2 answers

Gulp 4 Run task one after another

I'm trying to build a bit complex workflow in gulp 4, essentially I would like to run 5 tasks one after another every time I run the "default" gulp task (see tasks list below); but I have experienced some bugs, if I run them one by one manually, all…
Areon
  • 11
  • 4
1
vote
1 answer

gulp watch resulting in an endless loop after upgrading to gulp 4

I have upgraded my gulpfile.js to gulp 4. gulp dev is working fine. But whenever I am editing any file the reload and inject tasks are entering into an endless loop. My gulpfile.js: var gulp = require('gulp'), sass = require('gulp-sass'), …
zakaria
  • 426
  • 2
  • 15
1
vote
0 answers

BrowserSync working only once at the beginning of execution. The reload doesn't work after changes about my Scss files

I'm using Gulp 4 and BrowserSync doesn't reload my browser after changing my scss files. This my gulpfile.js. var gulp = require('gulp'); var browserSync = require('browser-sync').create(); // instance de browser-sync var sass =…
1
vote
0 answers

How to run shell script (.sh files) in Gulp 4?

Hello to everyone and Happy New Year! Since Gulp version 4 I can't run a shell script. I have simple shell script. if application id "com.adobe.estoolkit-4.0" is running then display dialog "Close The App!" buttons {"OK"} default button 1 end…
Vlad K.
  • 339
  • 1
  • 5
  • 15
1
vote
1 answer

Pass data between gulp 4 tasks, pipes or commandline

I'm trying to do in my opinion a simple task but can't figure it out. Can't find it on google or here. Maybe i'm doing it completely wrong. I need to change a property in a json file with gulp 4. To get the new value of the property I have another…
LockTar
  • 5,364
  • 3
  • 46
  • 72
1
vote
1 answer

Run gulp task in chokidar.on() callback

Gulp task 'Copy images' copies ALL image files on the first gulp run. Then, task 'Watch source files' watches the images source folder and imagesWatcher.on('add) intercepts added files. How I can call 'Copy images' from the 'watcher.on()'…
Takeshi Tokugawa YD
  • 670
  • 5
  • 40
  • 124
1
vote
1 answer

gulp.series doesn't serialize task

I'm using gulp 4 with Node 8 and the following setting gulp.task('task1', function(done) { gulp.src(...) .pipe(debug({title: 'TASK1'}) .pipe(...) done(); }); gulp.task('task2', function(done) { gulp.src(...) …
chepukha
  • 2,371
  • 3
  • 28
  • 40
1
vote
1 answer

Run multiple gulp4 tasks programmatically

How to run multiple node streams (generated by gulp) sequentially? Let's assume a simple gulpfile with two depending tasks: var gulp = require("gulp"); gulp.task("do1", function() { return gulp.src("./test/*") …
Markus
  • 3,225
  • 6
  • 35
  • 47
1
vote
1 answer

How to repeatedly launch a task from another task in gulp 4

I recently upgraded to gulp 4 and I am trying to solve a long standing issue of with my export process. In short I have 3 (or more) independent folders in my project. By independent I mean that they each have their own bundle.js and global.css file.…
NealVDV
  • 2,302
  • 3
  • 26
  • 51
0
votes
0 answers

Move task from Gulp 3.9 to 4 +

I have updated Gulp from 3.9 to 4. I'm not able to run the task. Below is the code before and after migration Before: gulp.task('default', [ 'html', 'assets', 'javascript', 'outside-scripts', 'css', 'libs', …
vishwas tej
  • 139
  • 1
  • 13
0
votes
0 answers

require is not defined in node16

I tryin to convert gulp3 to 4 there I fetching error ReferenceError: require is not defined Here is version information Gulp: 4.0.2 Node: 16.15.0 NPM: 9.6.1 Below code: delete require.cache[require.resolve(dir + file)] data[file.replace(/\.json$/,…
Mitul Sabhaya
  • 93
  • 1
  • 1
  • 5