Glup V4.0.0 'gulp start' is not a function

前端 未结 2 433
梦毁少年i
梦毁少年i 2021-01-11 15:45

I have this below gulpfile.js. When i run the app using \'gulp start\' then it is showing start is not a function. Glup-cli version i\'m using V4.0.0

const g         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-11 16:29

    gulp.start has been deprecated in v4. Depending on your needs, you can use gulp.series or gulp.parallel instead.

    - gulp.task('start', function() {
    -   devMode = true;
    -   gulp.start(['build', 'browser-sync']);
    + gulp.task('start', gulp.series('build', 'browser-sync'), function(done) {
    +   devMode = true;
        gulp.watch(['./src/css/**/*.css'], ['css']);
        gulp.watch(['./src/js/**/*.js'], ['js']);
        gulp.watch(['./src/templates/**/*.html'], ['html']);
      });
    

    This question is probably a duplicated of this one, but since that question hasn't got an accepted answer I'll just echo Mark's answer.

提交回复
热议问题