Get the current file name in gulp.src()

I’m not sure how you want to use the file names, but one of these should help: If you just want to see the names, you can use something like gulp-debug, which lists the details of the vinyl file. Insert this anywhere you want a list, like so: var gulp = require(‘gulp’), debug = require(‘gulp-debug’); … Read more

Gulp error: watch task has to be a function

In gulp 3.x you could just pass the name of a task to gulp.watch() like this: gulp.task(‘watch’, function() { gulp.watch(‘app/css/*.css’, [‘styles’]); gulp.watch(‘app/js/*.js’, [‘scripts’]); gulp.watch(‘app/img/*’, [‘images’]); }); In gulp 4.x this is no longer the case. You have to pass a function. The customary way of doing this in gulp 4.x is to pass a gulp.series() … Read more

Gulp + Webpack or JUST Webpack?

This answer might help. Task Runners (Gulp, Grunt, etc) and Bundlers (Webpack, Browserify). Why use together? …and here’s an example of using webpack from within a gulp task. This goes a step further and assumes that your webpack config is written in es6. var gulp = require(‘gulp’); var webpack = require(‘webpack’); var gutil = require(‘gutil’); … Read more

Everytime I run gulp anything, I get a assertion error. – Task function must be specified

Gulp 4.0 has changed the way that tasks should be defined if the task depends on another task to execute. The list parameter has been deprecated. An example from your gulpfile.js would be: // Starts a BrowerSync instance gulp.task(‘server’, [‘build’], function(){ browser.init({server: ‘./_site’, port: port}); }); Instead of the list parameter they have introduced gulp.series() … Read more

Can’t get Gulp to run: cannot find module ‘gulp-util’

UPDATE From later versions, there is no need to manually install gulp-util. Check the new getting started page. If you still hit this problem try reinstalling your project’s local packages: rm -rf node_modules/ npm install OUTDATED ANSWER You also need to install gulp-util: npm install gulp-util –save-dev From gulp docs- getting started (3.5): Install gulp … Read more

Prevent errors from breaking / crashing gulp watch

Your swallowError function should look like this: function swallowError (error) { // If you want details of the error in the console console.log(error.toString()) this.emit(‘end’) } I think you have to bind this function on the error event of the task that was falling, not the watch task, because that’s not where comes the problem, you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)