Build 调试glob模式(节点glob)
我有一个像这样的吞咽任务:Build 调试glob模式(节点glob),build,gulp,node-glob,gulp-glob,Build,Gulp,Node Glob,Gulp Glob,我有一个像这样的吞咽任务: const dest_free = "build/free"; gulp.task("build-free", ["clean-free"], function () { gulp.src(["src/**", "!src/composer.*", "LICENSE", "src/plugins/index.php", "!src/plugins/**"]) .pipe(gulp.dest(dest_free)); }); 我的目录结构: $ ls
const dest_free = "build/free";
gulp.task("build-free", ["clean-free"], function () {
gulp.src(["src/**", "!src/composer.*", "LICENSE", "src/plugins/index.php", "!src/plugins/**"])
.pipe(gulp.dest(dest_free));
});
我的目录结构:
$ ls -F src/plugins/
RecipeIndex/ VisitorRating/ index.php
我期待index.php
出现在build/free/plugins/
中,但它不是:
$ ls -F build/free/plugins/
$
我的问题是:
index.php
没有出现在build/free/plugins/
中附言:将gulp glob顺序更改为这一顺序没有任何区别:
[“src/**”,“!src/composer.*,“LICENSE”,“!src/plugins/**”,“src/plugins/index.php”]
要在@Cassidy Laidlaw的命令上展开,您可以尝试以下操作,或者使用上一篇文章中的其他选项进行调试:
var debug = require('gulp-debug');
gulp.task('build-free', ['clean-free'], function() {
return gulp.src(['src/**', '!src/composer.*', 'LICENSE', 'src/plugins/index.php', '!src/plugins/**'])
.pipe(debug())
.pipe(gulp.dest('build/free'));
});
这将向控制台输出行,如:
[22:23:05] gulp-debug: LICENSE
[22:23:05] gulp-debug: 1 item
要扩展@Cassidy Laidlaw的命令,您可以尝试以下操作,或使用上一篇文章中的其他选项进行调试:
var debug = require('gulp-debug');
gulp.task('build-free', ['clean-free'], function() {
return gulp.src(['src/**', '!src/composer.*', 'LICENSE', 'src/plugins/index.php', '!src/plugins/**'])
.pipe(debug())
.pipe(gulp.dest('build/free'));
});
这将向控制台输出行,如:
[22:23:05] gulp-debug: LICENSE
[22:23:05] gulp-debug: 1 item
这有用吗?您可以使用gulp debug来获取glob生成的文件。关于您的问题2,请参阅下面这家伙的精彩答案。基本上,求反是在最后执行的,因此未包含index.php的结果是预期结果。有关选项,请参见参考问题。这有帮助吗?您可以使用gulp debug来获取glob生成的文件。关于您的问题2,请参阅下面这家伙的精彩答案。基本上,求反是在最后执行的,因此未包含index.php的结果是预期结果。有关选项,请参见参考问题。