I'm using a gulpfile.js
generated by yeoman's gulp-webapp generator and modified slightly by me to fit my needs. For some reason I keep running into an issue when I try to run the build process(default task). The error is thrown during the 'html' task and most of the error references are in `node_modules\gulp-useref\index.js'.
Here is the error output:
stream.js:94
throw er; //Unhandled stream in pipe.
TypeError: path must be a string
at Object.fs.openSync (fs.js:427:18)
at Object.fs.readFileSync (fs.js:284:15)
at Transform.<anonymous> (C:\dev\project\node_modules\gulp-useref\index.js:54:44)
at Array.forEach (native)
at Transform.<anonymous> (C:\dev\project\node_modules\gulp-useref\index.js:50:31)
at Array.forEach (native)
at Transform.<anonymous> (C:\dev\project\node_modules\gulp-useref\index.js:41:36)
at Array.forEach (native)
at Transform._transform (C:\dev\project\node_modules\gulp-useref\index.js:38:23)
at Transform._read (C:\dev\project\node_modules\gulp-useref\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:184:10)
at Transform._write (C:\dev\project\node_modules\gulp-useref\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:172:12)
Here is the HTML task:
gulp.task('html', ['styles', 'scripts'], function () {
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');
return gulp.src(['app/**/*.html','app/**/*.php'])
.pipe($.useref.assets())
.pipe(jsFilter)
.pipe($.uglify())
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe($.csso())
.pipe(cssFilter.restore())
.pipe($.useref.restore())
.pipe($.useref())
.pipe(gulp.dest('dist'))
.pipe($.size());
});