@YoManYo
*

TypeError: dest.on is not a function! Но почему?

Всё вроде как по документации, а оно не работает. Я не понимаю. Помогите/объясните кому не трудно.

// Определяем константы Gulp
const { src, dest, parallel, series, watch } = require('gulp');

const browserSync = require('browser-sync').create();
const concat = require('concat');
const uglify = require('gulp-uglify-es').default;

function browsersync() {
    browserSync.init({
        server: { baseDir: 'app/' },
        notify: false,
        online: true
    })
}

function scripts() {
    return src([ // Берём файлы из источников
        'node_modules/jquery/dist/jquery.min.js',
        'app/js/app.js',
    ])
        .pipe(concat('app.min.js'))
        .pipe(uglify())
        .pipe(dest('app/js/'))
        .pipe(browserSync.stream())
}

exports.browsersync = browsersync;
exports.scripts = scripts;


Всё что касаемое ошибки из консоли:
C:\Users\10XSpeed\Desktop\my-project>gulp scripts
[19:38:12] Using gulpfile ~\Desktop\my-project\gulpfile.js
[19:38:12] Starting 'scripts'...
[19:38:12] 'scripts' errored after 15 ms
[19:38:12] TypeError: dest.on is not a function
    at DestroyableTransform.Readable.pipe (C:\Users\10XSpeed\Desktop\my-project\node_modules\readable-stream\lib\_stream_readable.js:564:8)
    at scripts (C:\Users\10XSpeed\Desktop\my-project\gulpfile.js:27:10)
    at scripts (C:\Users\10XSpeed\Desktop\my-project\node_modules\undertaker\lib\set-task.js:13:15)
    at bound (domain.js:416:15)
    at runBound (domain.js:427:12)
    at asyncRunner (C:\Users\10XSpeed\Desktop\my-project\node_modules\async-done\index.js:55:18)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
  • Вопрос задан
  • 385 просмотров
Решения вопроса 1
@YoManYo Автор вопроса
*
Разобрался. Я каким-то делом установил не тот пакет. Теперь всё работает. Вопрос закрыт!
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
Kentavr16
@Kentavr16
long cold winter
Итак, подокументации :
https://www.browsersync.io/docs/gulp/

Обратите внимание как обьявляется браузерсинк. А точнее gulp. Task
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы