Javascript-форум (https://javascript.ru/forum/)
-   Сборка проекта, утилиты (https://javascript.ru/forum/server-tools/)
-   -   Ошибки в GULP: 'default' errored after 3.32 s. Как исправить? (https://javascript.ru/forum/server-tools/78793-oshibki-v-gulp-%27default%27-errored-after-3-32-s-kak-ispravit.html)

Rina4x 05.11.2019 17:09

Ошибки в GULP: 'default' errored after 3.32 s. Как исправить?
 
Вложений: 1
C:\Users\Bunny\Desktop\new project> gulp
[16:25:04] Using gulpfile ~\Desktop\new project\gulpfile.js
[16:25:04] Starting 'default'...
[16:25:04] Starting 'css'...
[16:25:04] Starting 'scss'...
[16:25:04] Starting 'js'...
[16:25:04] Starting 'browser-sync'...
[16:25:04] Starting 'watch'...
[16:25:04] 'css' errored after 286 ms
[16:25:07] ReferenceError: _libs is not defined
at C:\Users\Bunny\Desktop\new project\gulpfile.js:24:19
at css (C:\Users\Bunny\Desktop\new project\node_modules\undertaker\lib\set-task.js:13:15)
at bound (domain.js:420:14)
at runBound (domain.js:433:12)
at asyncRunner (C:\Users\Bunny\Desktop\new project\node_modules\async-done\index.js:55:18)
at processTicksAndRejections (internal/process/task_queues.js:75:11)
[16:25:07] 'default' errored after 3.32 s
[16:25:07] The following tasks did not complete: scss, js, browser-sync, watch
[16:25:07] Did you forget to signal async completion?
-------------------------------------------------------------------------------

let gulp = require('gulp'),
sass = require('gulp-sass'),
browserSync = require('browser-sync'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
rename = require('gulp-rename');
gulp.task('scss', function(){
return gulp.src('app/scss/**/*.scss')
.pipe(sass({outputStyle: 'compressed'}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({stream: true}))
});

gulp.task('css', function(){
return gulp.src([
'node_modules/normalize.css/normalize.css',
'node_modules/slick-carousel/slick/slick.css',
'node_modules/magnific-popup/dist/magnific-popup.css'
])
.pipe(concat(_libs.scss))
.pipe(gulp.dest('app/scss'))
.pipe(browserSync.reload({stream: true}))
});

gulp.task('html', function(){
return gulp.src('app/*.html')
.pipe(browserSync.reload({stream: true}))
});

gulp.task('script', function(){
return gulp.src('app/js/*.js')
.pipe(browserSync.reload({stream: true}))
});

gulp.task('js', function(){
return gulp.src([
'node_modules/slick-carousel/slick/slick.js',
'node_modules/magnific-popup/dist/jquery.magnific-popup.js'
])
.pipe(concat('libs.min.js'))
.pipe(uglify())
.pipe(gulp.dest('app/js'))
.pipe(browserSync.reload({stream: true}))
});

gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "app/"
}
})
});

gulp.task('watch', function(){
gulp.watch('app/scss/**/*.scss' , gulp.parallel('scss'))
gulp.watch('app/*.html', gulp.parallel('html'))
gulp.watch('app/js/*.js', gulp.parallel('script'))
});

gulp.task('default', gulp.parallel('css', 'scss', 'js', 'browser-sync', 'watch'));


Часовой пояс GMT +3, время: 08:24.