Skip to content

Commit 879ba33

Browse files
committed
Merge pull request DefinitelyTyped#4836 from tkrotoff/gulp-minify-html
Add definitions for gulp-minify-html
2 parents 2fe8a6f + 51d2956 commit 879ba33

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/// <reference path="gulp-minify-html.d.ts" />
2+
/// <reference path="../gulp/gulp.d.ts" />
3+
4+
import gulp = require('gulp');
5+
import minifyHtml = require('gulp-minify-html');
6+
7+
minifyHtml();
8+
minifyHtml({conditionals: true, loose: true});
9+
10+
gulp.task('minify-html', () => {
11+
var opts = {
12+
conditionals: true,
13+
spare: true
14+
};
15+
16+
return gulp.src('./static/html/*.html')
17+
.pipe(minifyHtml(opts))
18+
.pipe(gulp.dest('./dist/'));
19+
});
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Type definitions for gulp-minify-html v1.0.2
2+
// Project: https://github.com/murphydanger/gulp-minify-html
3+
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="../node/node.d.ts" />
7+
8+
declare module 'gulp-minify-html' {
9+
interface IOptions {
10+
// Do not remove empty attributes
11+
empty?: boolean;
12+
13+
// Do not strip CDATA from scripts
14+
cdata?: boolean;
15+
16+
// Do not remove comments
17+
comments?: boolean;
18+
19+
// Do not remove conditional internet explorer comments
20+
conditionals?: boolean;
21+
22+
// Do not remove redundant attributes
23+
spare?: boolean;
24+
25+
// Do not remove arbitrary quotes
26+
quotes?: boolean;
27+
28+
// Preserve one whitespace
29+
loose?: boolean;
30+
}
31+
32+
function minifyHtml(options?: IOptions): NodeJS.ReadWriteStream;
33+
34+
export = minifyHtml;
35+
}

0 commit comments

Comments
 (0)