F
F
freeman02042016-05-03 13:33:07
JavaScript
freeman0204, 2016-05-03 13:33:07

Why is gulp.series and gulp.parallel not a function?

Setting up gulp here are my settings.

const gulp = require('gulp');
const concatCSS = require('gulp-concat-css');
const debug = require('gulp-debug');
const sourcemaps = require('gulp-sourcemaps');
const gulpIf = require('gulp-if');
const del = require('del');
const series = require('gulp-series');

const isDevelopment = !process.env.NODE_ENV || process.env.NODE_ENV == 'development';

gulp.task('css', function () {

  return gulp.src('frontend/**/*.css')
    .pipe(concatCSS('all.css'))
    .pipe(gulpIf(isDevelopment, sourcemaps.init()))
    .pipe(gulpIf(isDevelopment, sourcemaps.write()))
    .pipe(gulp.dest('public'));

});

gulp.task('clean', function() {
  return del('public');
});

gulp.task('assets', function() {
  return gulp.src('frontend/assets/**')
    .pipe(gulp.dest('public'));
});

gulp.task('build', gulp.series(
  'clean',
  gulp.parallel('css', 'assets'))
);

In the author of the lesson
const del = require('del');
const series = require('gulp-series'); it does not install del, as I understand it, the built-in plugin, but it didn’t work for me without installing it, also series doesn’t have this line at all const series = require('gulp-series'); but it works, as I understand it, this is also a built-in plugin. Here is what I get in the console gulp.series and gulp.parallel is not a function. Why is that?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question