Merge pull request #4836 from tkrotoff/gulp-minify-html

Add definitions for gulp-minify-html
This commit is contained in:
Horiuchi_H
2015-07-07 09:44:55 +09:00
2 changed files with 54 additions and 0 deletions
@@ -0,0 +1,19 @@
/// <reference path="gulp-minify-html.d.ts" />
/// <reference path="../gulp/gulp.d.ts" />
import gulp = require('gulp');
import minifyHtml = require('gulp-minify-html');
minifyHtml();
minifyHtml({conditionals: true, loose: true});
gulp.task('minify-html', () => {
var opts = {
conditionals: true,
spare: true
};
return gulp.src('./static/html/*.html')
.pipe(minifyHtml(opts))
.pipe(gulp.dest('./dist/'));
});
+35
View File
@@ -0,0 +1,35 @@
// Type definitions for gulp-minify-html v1.0.2
// Project: https://github.com/murphydanger/gulp-minify-html
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'gulp-minify-html' {
interface IOptions {
// Do not remove empty attributes
empty?: boolean;
// Do not strip CDATA from scripts
cdata?: boolean;
// Do not remove comments
comments?: boolean;
// Do not remove conditional internet explorer comments
conditionals?: boolean;
// Do not remove redundant attributes
spare?: boolean;
// Do not remove arbitrary quotes
quotes?: boolean;
// Preserve one whitespace
loose?: boolean;
}
function minifyHtml(options?: IOptions): NodeJS.ReadWriteStream;
export = minifyHtml;
}