added html beautifier, more content

This commit is contained in:
Joshua Seigler 2017-02-13 01:06:51 -05:00
parent 548c6b88f7
commit 6a456783f5
12 changed files with 196 additions and 15 deletions

View file

@ -1,6 +1,6 @@
/*jslint
node: true
regexp: true*/
*/
'use strict';
/**
@ -25,6 +25,8 @@ var gulp = require('gulp'),
svgmin = require('gulp-svgmin'), // minifies SVGs to save filesize
notify = require('gulp-notify'), // pops up OS notifications
revAll = require('gulp-rev-all'), // hashes static resources, updates references to them
gulpif = require('gulp-if'), // conditionally process part of a vinyl stream
htmlbeautify = require('gulp-html-beautify'), // clean up HTML formatting
path = require('path'),
spawn = require('child_process').spawn,
// Define source and destination paths
@ -143,10 +145,32 @@ gulp.task('build:site', ['clean:site', 'build:less', 'build:icons'], function ()
child.on('close', function (code) {
gutil.log("Done with exit code", code);
gulp.src('./dist/**')
.pipe(gulpif('*.html', htmlbeautify({
"indent_size": 2,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": false,
"max_preserve_newlines": 10,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": false,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 0,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 4,
"end_with_newline": false
})))
.pipe(revAll.revision({ dontRenameFile: [
/^\/favicon\.ico$/g,
/.*\.html$/g,
/.*\.xml$/g
/\.html$/g,
/\.xml$/g
] }))
.pipe(gulp.dest('./cdn'));
});