Добрый день!
Есть код в gulpfile.js, но он не работает
let gulp = require('gulp'),
minCSS = require('gulp-clean-css'),
browserSync = require('browser-sync').create();
// Static Server + watching css/html files
gulp.task('serve', gulp.series ('minCSS'), async function() {
browserSync.init({
server: 'app/'
});
gulp.watch('app/styles/*.css', gulp.series ('minCSS'));
gulp.watch('app/*.html').on('change', browserSync.reload);
});
// Minify CSS files
gulp.task('minCSS', async function () {
gulp.src('app/styles/*.css')
.pipe(minCSS())
.pipe(gulp.dest('temp/css'))
.pipe(browserSync.stream());
});
gulp.task('default', gulp.series ('serve'));
При вводе gulp в командной строке, выходит это:
assert.js:374
throw err;
^
AssertionError [ERR_ASSERTION]: Task never defined: minCSS
at getFunction (C:\Users\User\Desktop\trillions\node_modules\undertaker\lib\helpers\normalizeArgs.js:15:5)
at map (C:\Users\User\Desktop\trillions\node_modules\arr-map\index.js:20:14)
at normalizeArgs (C:\Users\User\Desktop\trillions\node_modules\undertaker\lib\helpers\normalizeArgs.js:22:10)
at Gulp.series (C:\Users\User\Desktop\trillions\node_modules\undertaker\lib\series.js:13:14)
at Object.<anonymous> (C:\Users\User\Desktop\trillions\gulpfile.js:6:25)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Module.require (internal/modules/cjs/loader.js:848:19) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: undefined,
expected: true,
operator: '=='
}