UNPKG

3.63 kBMarkdownView Raw
1# gulp-htmlmin [![NPM version](https://img.shields.io/npm/v/gulp-htmlmin.svg?style=flat)](https://www.npmjs.com/package/gulp-htmlmin) [![NPM monthly downloads](https://img.shields.io/npm/dm/gulp-htmlmin.svg?style=flat)](https://npmjs.org/package/gulp-htmlmin) [![NPM total downloads](https://img.shields.io/npm/dt/gulp-htmlmin.svg?style=flat)](https://npmjs.org/package/gulp-htmlmin) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/gulp-htmlmin.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/gulp-htmlmin)
2
3> gulp plugin to minify HTML.
4
5Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
6
7## Install
8
9Install with [npm](https://www.npmjs.com/):
10
11```sh
12$ npm install --save gulp-htmlmin
13```
14
15## Heads up!
16
17_**Please do not report issues related to HTML parsing and output on this repository. Report those issues to the [html-minifier](https://github.com/kangax/html-minifier/issues) issue tracker.**_
18
19## Usage
20
21See the [html-minifer docs](https://github.com/kangax/html-minifier) for all available options.
22
23```js
24const gulp = require('gulp');
25const htmlmin = require('gulp-htmlmin');
26
27gulp.task('minify', () => {
28 return gulp.src('src/*.html')
29 .pipe(htmlmin({ collapseWhitespace: true }))
30 .pipe(gulp.dest('dist'));
31});
32```
33
34## About
35
36<details>
37<summary><strong>Contributing</strong></summary>
38
39Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
40
41</details>
42
43<details>
44<summary><strong>Running Tests</strong></summary>
45
46Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
47
48```sh
49$ npm install && npm test
50```
51
52</details>
53
54<details>
55<summary><strong>Building docs</strong></summary>
56
57_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
58
59To generate the readme, run the following command:
60
61```sh
62$ npm install -g verbose/verb#dev verb-generate-readme && verb
63```
64
65</details>
66
67### Contributors
68
69| **Commits** | **Contributor** |
70| --- | --- |
71| 41 | [shinnn](https://github.com/shinnn) |
72| 20 | [jonschlinkert](https://github.com/jonschlinkert) |
73| 11 | [doowb](https://github.com/doowb) |
74| 7 | [stevelacy](https://github.com/stevelacy) |
75| 2 | [TheDancingCode](https://github.com/TheDancingCode) |
76| 1 | [cwonrails](https://github.com/cwonrails) |
77| 1 | [igoradamenko](https://github.com/igoradamenko) |
78| 1 | [oblador](https://github.com/oblador) |
79| 1 | [jdalton](https://github.com/jdalton) |
80| 1 | [JoseChirivella14](https://github.com/JoseChirivella14) |
81| 1 | [nschloe](https://github.com/nschloe) |
82| 1 | [tomByrer](https://github.com/tomByrer) |
83
84### Author
85
86**Jon Schlinkert**
87
88* [GitHub Profile](https://github.com/jonschlinkert)
89* [Twitter Profile](https://twitter.com/jonschlinkert)
90* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
91
92**Shinnosuke Watanabe**
93
94* [GitHub Profile](https://github.com/shinnn)
95* [Twitter Profile](https://twitter.com/shinnn_tw)
96* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
97
98### License
99
100Copyright © 2018, [Shinnosuke Watanabe](https://github.com/shinnn).
101Released under the [MIT License](LICENSE).
102
103***
104
105_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on September 08, 2018._