【发布时间】:2016-08-26 19:44:10
【问题描述】:
在我的 gulpfile 中,我将一些文件注入到 appcache 清单中,如下所示:
var cachedFiles = gulp.src('**', {read: false, cwd: 'build'});
gulp.src('src/*.appcache', {base: 'src'})
.pipe($.inject(cachedFiles, {
addRootSlash: false,
starttag: '# inject',
endtag: '# endInject',
transform: function(path) {
return path;
}
}))
.pipe(gulp.dest(deployPath));
它或多或少有效,但也注入文件夹:
# inject
index.html
app # <-- I don't want this
app/20_main.js
app/filters.js
view # <-- I don't want this
view/style.css
如何忽略文件夹本身,但仍将文件包含在其中?谷歌搜索会导致很多关于排除包含内容的文件夹的问题。
【问题讨论】:
标签: javascript gulp glob