S
S
Sergey2016-01-26 21:23:32
gulp.js
Sergey, 2016-01-26 21:23:32

Got a bug in gulp?

--> Файл app\common-bundle\styles\block\_header.scss был изменен
[21:13:17] Starting 'common-bundle-build-sass'...
[21:13:17] Finished 'common-bundle-build-sass' after 22 ms
[21:13:17] 'common-bundle-watch-sass' errored after 2.93 min
[21:13:17] Error: task completion callback called too many times
    at finish (D:\hosting\radin\node_modules\orchestrator\lib\runTask.js:15:10)
    at cb (D:\hosting\radin\node_modules\orchestrator\lib\runTask.js:29:3)
    at apply (D:\hosting\radin\node_modules\thunks\thunks.js:344:38)
    at tryRun (D:\hosting\radin\node_modules\thunks\thunks.js:224:19)
    at callback (D:\hosting\radin\node_modules\thunks\thunks.js:193:24)
    at next (D:\hosting\radin\node_modules\thunks\thunks.js:314:31)
    at Gulp.successListener (D:\hosting\radin\node_modules\gulp-sequence\index.js:42:11)
    at emitOne (events.js:82:20)
    at Gulp.emit (events.js:169:7)
    at Gulp.Orchestrator._emitTaskDone (D:\hosting\radin\node_modules\orchestrator\index.js:264:8)

// Слежение за sass файлами
gulp.task('common-bundle-watch-sass', function(cb) {
  gulp.watch('app/common-bundle/**/*.scss')
    .on('add', (path) => {
      console.log('--> Файл ' + path + ' добавлен на слежение');
      gulpSequence('common-bundle-build-sass')(cb);
    })
    .on('unlink', (path) => {
      console.log('--> Файл ' + path + ' был удален');
      gulpSequence('common-bundle-rebuild-sass')(cb);
    })
    .on('change', (path) => {
      console.log('--> Файл ' + path + ' был изменен');
      gulpSequence('common-bundle-build-sass')(cb);
    })
})

Occurs when a file is changed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-01-28
@Sergamers

In watch files, you do not need to do task synchronism. It was necessary to divide into 2 tasks
1. building the project
2. tracking the change

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question