如何吞噬观看父目录

时间:2018-12-14 16:33:22

标签: gulp gulp-watch

我尝试从另一个目录的根目录吞食一个目录。

root
+-- myproject
|   +-- src
|   +-- gulp.js  <----
+-- otherproject
    +-- src

在gulp.js文件中,我创建了任务:

gulp.task('watch', function () {
    gulp.watch('./src/**/*', ['watchCurrentFolder']);
    gulp.watch('../otherproject/src/**/*', ['watchAnotherFolder']);
});

此任务正常运行:

gulp.task('watchCurrentFolder', function () {
  gulp.src(['./src/**/*']).pipe(gulp.dest('./dist'));
});

此任务从未触发:

gulp.task('watchAnotherFolder', function () {
      gulp.src(['../otherproject/src/**/*']).pipe(gulp.dest('./dist'));
    });

如何从gulp.js观看“ otherproject”文件夹?

0 个答案:

没有答案
相关问题