我使用generator-gulp-webapp并有27个html文件编译到.tmp
文件夹。我发现在gulp-useref任务中,只有前25个html文件将被处理并传递到dist
文件夹。这里是gulpfile.coffee
的代码,真的需要知道如何解决这个问题,谢谢。gulp-useref忽略文件,如果有超过25个文件
gulp.task 'views', ->
gulp.src [
'!app/mixins/**/*.jade'
'!app/layouts/**/*.jade'
'!app/partials/**/*.jade'
'app/**/*.jade'
], base: 'app'
.pipe $.data (file) ->
return JSON.parse fs.readFileSync '.tmp/data.json'
.pipe $.jade
pretty: true
basedir: 'app/'
compileDebug: true
.on 'error', (err) ->
$.notify
title: 'Jade compile failed.',
sound: 'Sosumi'
.write err.message
.pipe gulp.dest '.tmp'
gulp.task 'htmlProcess', ['views', 'styles', 'scripts', 'compass'], ->
assets = $.useref.assets
searchPath: ['.tmp', 'app', '.']
gulp.src ['app/**/*.html', '.tmp/**/*.html']
.pipe assets
.pipe assets.restore()
.pipe $.useref()
.pipe gulp.dest 'dist'
你能告诉我们你的原始文件吗? – ddprrt
对不起,我无法向您显示这些文件,因为它是我客户的私人项目。这是原始的[gulpfile.coffee](https://gist.github.com/judewang/efc57ce38cf31e202f94),我发现如果我删除属于'htmlProcess'的一个或两个任务,那么它可以编译所有文件而不会丢失。 – Jude