Gulp 无法识别来自单独文件的吞咽任务

Gulp 无法识别来自单独文件的吞咽任务,gulp,Gulp,我正在使用以下文件夹结构来完成我的gulp任务 app |-gulpfile.js //content of this given next |-build | |-tasks | |-watch.js //defines a task named "watch" which depends on task "watch-www" defined inside folder "www" below |-www | |-gulpfile.js

我正在使用以下文件夹结构来完成我的gulp任务

app
   |-gulpfile.js //content of this given next
   |-build
   |   |-tasks
   |      |-watch.js //defines a task named "watch" which depends on task "watch-www" defined inside folder "www" below
   |-www
   |   |-gulpfile.js //not used
   |   |-build
   |       |-tasks
   |          |-watch-www.js //defines a task "watch-wwww"
顶层gulp文件的内容如下

require('require-dir')('./www/build/tasks', {recursive: true});
require('require-dir')('./build/tasks');
当我运行
gulp watch
时,我收到一个错误,提示
任务“watch www”不在您的gulpfile

包含任务
watch
watch.js
的内容如下

var gulp = require('gulp');
var paths = require('../paths');
var browserSync = require('browser-sync');

// outputs changes to files to the console
function reportChange(event) {
  console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
}

gulp.task('watch', ['watch-www'], function() {
  gulp.watch(paths.api, [browserSync.reload]).on('change', reportChange);
  gulp.watch(paths.www, [browserSync.reload]).on('change', reportChange);
});

我做错了什么?

你的图表显示“任务”目录在gulpfile.js下?@Bnaya谢谢,修复了。你检查了
watch-www.js
是否实际加载了吗?我如何检查?watch-www的内容是什么?