Gulp run alternative

后端 未结 3 1953
旧时难觅i
旧时难觅i 2021-01-13 14:31

Everytime I run gulp, I see this message gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead.

Example code:

3条回答
  •  自闭症患者
    2021-01-13 15:19

    gulp.run() was deprecated because people were using it as a crutch. You are using it as a crutch!

    I'm not sure why you're using gulp-watch, the built in gulp.watch would be far more appropriate for what you're using it for. Have a look at the documentation for .watch: https://github.com/gulpjs/gulp/blob/master/docs/API.md#gulpwatchglob--opts-tasks-or-gulpwatchglob--opts-cb

    Here's what you should have written. Please understand why you're using it instead of just copying it:

    gulp.watch(['public/**/*.js','!public/**/*.min.js'], ['compressjs', 'bs-reload'])
    

提交回复
热议问题