S
S
Sergey2015-08-25 18:35:48
Node.js
Sergey, 2015-08-25 18:35:48

How to fix error in Gulp task file?

In gulpfile.js, I'm trying to create a test local server and set up live reload on it:

// Запуск сервера разработки gulp watch
gulp.task('watch', function() {
    // Предварительная сборка проекта
    gulp.run('stylus');
    gulp.run('jade');
    gulp.run('images');
    gulp.run('js');

    // Подключаем Livereload
    server.listen(35729, function(err) {
        if (err) return console.log(err);

        gulp.watch('assets/stylus/**/*.styl', ['stylus']);
        gulp.watch('assets/template/**/*.jade', ['jade']);
        gulp.watch('assets/img/**/*', ['images'])
        gulp.watch('assets/js/**/*', ['js'])
    });
    gulp.run('http-server');
});

gulp.task('watch', function () {
  var server = ['jasmine', 'embed'];
  var client = ['scripts', 'styles', 'copy', 'lint'];
  gulp.watch('app/*.js', server);
  gulp.watch('spec/nodejs/*.js', server);
  gulp.watch('app/backend/*.js', server);
  gulp.watch('src/admin/*.js', client);
  gulp.watch('src/admin/*.css', client);
  gulp.watch('src/geojson-index.json', ['copygeojson']);
});

Error in console: "gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead." I understand that instead of the obsolete run, you need to use something else, but since I'm not strong in js and I'm using gulp for the first time in my life, I can't figure out how to write it down correctly. I would appreciate any help, thanks.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question