Reputation: 39018
I'm using Gulp for our build process. One of the major tasks it needs to accomplish is combining all our .html
template partials from all the module folders into 1 .js
templateCache file. Which creates just 1 download for the user for all the HTML
files.
Current Gulp require and config setup:
var gulp = require('gulp'),
gutil = require('gulp-util'),
gulpif = require('gulp-if'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
sass = require('gulp-ruby-sass'),
streamqueue = require('streamqueue'),
sourcemaps = require('gulp-sourcemaps'),
templateCache = require('gulp-angular-templatecache'),
runSequence = require('run-sequence'),
del = require('del'),
es = require('event-stream');
var config = {
srcPartials:[
'app/beta/*',
'app/header/**/*',
'app/help/*',
'app/login/*',
'app/notificaitons/*',
'app/panels/**/*',
'app/popovers/**/*',
'app/popovers/*',
'app/user/*',
'app/dashboard.html'
],
destPartials: [
'app/templates/'
]
};
The html-templates
Gulp task:
/** HTML Template caching */
/** ------------------------------------------------------------------------- */
gulp.task('html-templates', function() {
return gulp.src(config.srcPartials)
.pipe(templateCache())
.pipe(gulp.dest(config.destPartials));
});
^ so as you can see above, I'm aiming to take all the .html files from all the folders listed in srcPartials
and run templateCache
on them and export out to the dest in destPartials
.
However currently getting this error:
Error: Invalid output folder at Gulp.dest
At first I thought that this task didn't automatically create the folder, so I went ahead and created the app/templates
folder, but still getting this error :( any thoughts?
Upvotes: 4
Views: 2616
Reputation: 39018
Ah just stumbled onto the answer: The output folder is a string, not an array.
https://github.com/gulpjs/gulp/issues/496
Upvotes: 4