I am not sure on to make the below given code to work:
var language = ['en', 'sp'];
gulp.task('jsonResourcesConcat', function() {
return gulp.src('path/to/json/' + language + '/resources.json')
.pipe(insert.prepend('window.resourcesData.' + language + ' = '))
.pipe(concat('resources-' + language +'.js'))
.pipe(gulp.dest('./www/assets/json2js/'));
});
I need the file should be output to folder ./www/assets/json2js/ with file names 'resources-en.js' and 'resources-sp.js'