Getting error: Invalid output folder when using gulp - angular-templatecache to generate combined HTML template file

I am using Gulp for our build process. One of the main tasks that needs to be done is to merge all of our .html

template parts from all module folders into 1 .js

templateCache. Which creates just 1 user upload for all files HTML

.

gulp-angular-templatecache


Current Gulp setup 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/'
    ]
};

      

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 going to take all .html files from all folders listed in srcPartials

and run templateCache

on them and export to dest in destPartials

.

However, when getting this error:

Error: Invalid output folder in Gulp.dest

At first I thought that this task didn't automatically create the folder, so I went and created the folder app/templates

, but I still get this error :( any thoughts?

+3


source to share


1 answer


And just stumbled upon the answer: The output folder is a string, not an array.

https://github.com/gulpjs/gulp/issues/496



~ @stevelality

+3


source







All Articles