0
我有一口任务的问题:咕嘟咕嘟具有文件夹被命名为喜欢的文件
gulp.task('css-dependencies', function() {
return gulp.src(['bower_components/**/*.css','!bower_components/**/*.min.css'])
.pipe(rename({dirname: './css'}))
.pipe(gulp.dest('./'));
});
但是我想用animate.css
并通过亭子加把它夹在工作正常的所有其他部件,所谓animate.css
:
Project
|
+-- bower_components
|
+-- animate.css
|
+--animate.css
+--animate.min.css (etc)
导致的重命名任务一饮而尽失败:
Error: EISDIR: illegal operation on a directory, open ‘~/css/animate.css' at Error (native)
除了特别豁免之外,我该如何解决这个问题?
您需要粘贴不仅仅是代码工作正常,你已经尝试的代码。 – catssay
@catssay我的代码不适用于我描述的情况。我可以为它设置一个特定的用例,这将起作用,但不可扩展。由于src是一个模式匹配(我相信)我不能想办法只匹配文件,而不是目录。 – Rudiger
我已经寻找吞的源代码和描绘路径的解释,这是一个所谓的模块[圆顶封装体亲本(https://github.com/es128/glob-parent)时,'bower_components/**/* .css'会给你的'bower_components'不bower_components/*',所以它实际上是在'归还所有css文件bower_components'不'bower_components/*',如果你想在完全相同的文件'bower_components/*'父路径,你需要像'bower_components/\ * */*。css'一样转义'*'。你可以在gulp项目中引发一个问题。 – catssay