This plugin uses https://github.com/jonschlinkert/pretty to format html
npm i @nean/gulp-pretty
const gulp = require('gulp');
const pretty = require('@nean/gulp-pretty');
gulp.task('templates', () => {
return gulp.src('templates/**/*.html')
.pipe(pretty({ocd: true}))
.pipe(gulp.dest('dist'));
});