Glob / minimatch: how to gulp.src() everything, then exclude folder but keep one file in it

This seems to work: gulp.src([ baseDir + ‘/**’, // Include all ‘!’ + baseDir + ‘/excl1{,/**}’, // Exclude excl1 dir ‘!’ + baseDir + ‘/excl2/**/!(.gitignore)’, // Exclude excl2 dir, except .gitignore ], { dot: true }); Excluding single file from glob match was tricky because there’s no similar examples in minimatch docs. https://github.com/isaacs/minimatch “If the … Read more

How to test Gulp tasks

My approach is to create a test instance and use exec and yeoman-assert. Though it feels more like an integration test, I find it helpful to be sure the tasks run properly (my use case being a yeoman-generator). Some (mocha) example: ‘use strict’; var path = require(‘path’); var helpers = require(‘yeoman-generator’).test; var assert = require(‘yeoman-generator’).assert; … Read more

Gulp + browserify + 6to5 + source maps

Use this as your start point: var gulp = require(‘gulp’); var gutil = require(‘gulp-util’); var sourcemaps = require(‘gulp-sourcemaps’); var source = require(‘vinyl-source-stream’); var buffer = require(‘vinyl-buffer’); var browserify = require(‘browserify’); var to5ify = require(‘6to5ify’); var uglify = require(‘gulp-uglify’); gulp.task(‘default’, function() { browserify(‘./src/index.js’, { debug: true }) .transform(to5ify) .bundle() .on(‘error’, gutil.log.bind(gutil, ‘Browserify Error’)) .pipe(source(‘bundle.js’)) .pipe(buffer()) .pipe(sourcemaps.init({loadMaps: … Read more

Is there a way to rewrite the HTML to use gulp-minified CSS

The best way to handle this is to use one of the HTML injectors from the get-go. I’m using gulp-inject to some success so far. Add gulp-inject to your project: npm i –save-dev gulp-inject Assuming that you have a folder layout similar to this: build/ src/ index.html less/ main.less js/ app.js Your HTML should include … Read more

Gulp doesn’t work

This error message indicates that the module ‘del’ cannot be found. It seems that the ‘del’ package is not installed or not properly configured in your project. Try installing the ‘del’ package by running the following command in your terminal: npm install del –save-dev If you have already installed ‘del’ package and still getting this … Read more

Gulp AssertionError [ERR_ASSERTION]: Task function must be specified

I just run into the same problem while upgrading to gulp 4. The depending tasks have to be specified as series or in parallel, just the name is not enough anymore. Example gulp.task(‘copy’, [‘sass-min’], function() { Becomes gulp.task(‘copy’, gulp.series(‘sass-min’), function() { gulp.parallel can also be used to execute the tasks in parallel

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