1

Why error sync?
"Did you forget to signal async completion?"
tried (cb) at the beginning and end of function buildScripts, same thing.
At this point I pass a training course on frontend development, do everything according to instructions
I can also give a link to the github with the code.

"use strict";

var { watch, src, dest, parallel, series } = require('gulp');

var webpack = require('webpack-stream')

var browserSync = require('browser-sync');
function devServer(cb) {
  var params = {
    watch: true,
    reloadDebounce: 150,
    notify: false,
    server: { baseDir: './build' },
  };
  
  browserSync.create().init(params);
  cb();
}

const { stream } = require('browser-sync');

function buildScripts() {
  return src('src/scripts/**/*.js')
    .pipe(dest('build/scripts/'));
}


function clearBuild() {
  return del('build/');
}


function watchFiles() {
  watch('src/scripts/**/*.js', buildScripts);
}

exports.default =
  series(
    clearBuild,
    parallel(
      devServer,
      series(
        parallel(buildPages, buildStyles, buildScripts, buildAssets),
        watchFiles
      )
    )
  );
...
        
AddJs
  • 11
  • 1

0 Answers0