Answer the question
In order to leave comments, you need to log in
Why is the task called several times in a row?
const {
src,
dest,
parallel,
series,
watch
} = require('gulp')
const zip = require('gulp-zip')
/**
* Начало сборки
* @object startBuild
*/
const startBuild = {
// Инициализация сборки виджета
init: async function() {
// Отслеживание файлов
tracking()
// Архивирование виджета
archiving()
}
}
/**
* Отслеживание изменений
* @function tracking
*/
function tracking() {
watch(['app/**/*'], archiving)
}
/**
* Архивирование виджета
* @function archiving
*/
function archiving() {
return src('app/*')
.pipe(zip('widget.zip'))
.pipe(dest('widget'))
}
exports.tracking = tracking()
exports.archiving = archiving()
// Запуск сборки
exports.default = parallel( startBuild.init )
[11:53:14] Using gulpfile /gulpfile.js
[11:53:14] Starting 'default'...
[11:53:14] Starting 'tracking'...
[11:53:17] Starting 'archiving'...
[11:53:17] Starting 'archiving'...
[11:53:17] Finished 'archiving' after 17 ms
[11:53:17] Finished 'archiving' after 15 ms
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question