Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I run a gulp task for Zen I get
TypeError: $.if is not a function
at Gulp.<anonymous> (/path/to/project/gulpfile.js:134:15)
at module.exports (/path/to/project/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/path/to/project/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/path/to/project/node_modules/orchestrator/index.js:214:10)
at /path/to/project/node_modules/orchestrator/index.js:279:18
at finish (/path/to/project/node_modules/orchestrator/lib/runTask.js:21:8)
at /path/to/project/node_modules/orchestrator/lib/runTask.js:43:4
for
line 134 in my gulpfile.js is
.pipe($.if(browserSync.active, browserSync.stream({match: '**/*.css'})));
Commenting out the line seems to disable automatically reloading the browser when a new styles.css is created.
Any ideas how to fix this would be very much appreciated. Thanks!
Comments
Comment #2
criscomWhat I did was to uncomment line 134 and substitute it with
.pipe(browserSync.stream())
This does not throw any errows and also browserSync works fine.
Not sure what
.pipe($.if(browserSync.active, browserSync.stream({match: '**/*.css'})));
is for anyway.
Comment #3
JohnAlbinThe
$
is the gulp-load-plugins package and$.if
is the the gulp-if package.As long as you have both of those packages in your package.json file, the gulpfile.js should work fine.