I am using gulp to minify Javascript, but including it in handlebars.
So I have to rename the file to .js
then minify it, and then rename it back to .hbs
I do this in 3 steps as follows:
gulp.task('footer-rename', function () {
return gulp.src("/var/www/html/myfooddataNODE/views/partials/js/footerJS.hbs")
.pipe(concat('footer.js'))
.pipe(gulp.dest("/var/www/html/myfooddataNODE/views/partials/js"));
});
gulp.task('pack-footer-js', function () {
return gulp.src(['/var/www/html/myfooddataNODE/views/partials/js/footer.js'])
.pipe(strip())
.pipe(concat('footerMin.js'))
.pipe(minify({ext:{min:'.js'},noSource: true}))
.pipe(gulp.dest('/var/www/html/myfooddataNODE/views/partials/js'));
});
gulp.task('footer-rename-2', function () {
return gulp.src("/var/www/html/myfooddataNODE/views/partials/js/footerMin.js")
.pipe(concat('footerMIN.hbs'))
.pipe(gulp.dest("/var/www/html/myfooddataNODE/views/partials/js"));
});
Is there a way to combine these 3 steps into one?
Also, I may end up just using a .js
file, but plan to use this same process to convert .hbs
into .html
and then back to .hbs
Thanks for any help!