我尝试从另一个目录的根目录吞食一个目录。
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”文件夹?