Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anseki/gulp-htmlclean
Simple and safety HTML/SVG cleaner to minify without changing its structure.
https://github.com/anseki/gulp-htmlclean
clean comment compress gulp gulpplugin html javascript lightweight linebreak minify svg unneeded-whitespaces whitespace
Last synced: 7 days ago
JSON representation
Simple and safety HTML/SVG cleaner to minify without changing its structure.
- Host: GitHub
- URL: https://github.com/anseki/gulp-htmlclean
- Owner: anseki
- License: mit
- Created: 2014-09-16T09:13:34.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-06-17T01:59:21.000Z (5 months ago)
- Last Synced: 2024-10-31T13:27:05.269Z (13 days ago)
- Topics: clean, comment, compress, gulp, gulpplugin, html, javascript, lightweight, linebreak, minify, svg, unneeded-whitespaces, whitespace
- Language: JavaScript
- Homepage:
- Size: 126 KB
- Stars: 11
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-htmlclean
[![npm](https://img.shields.io/npm/v/gulp-htmlclean.svg)](https://www.npmjs.com/package/gulp-htmlclean) [![GitHub issues](https://img.shields.io/github/issues/anseki/gulp-htmlclean.svg)](https://github.com/anseki/gulp-htmlclean/issues) [![David](https://img.shields.io/david/anseki/gulp-htmlclean.svg)](package.json) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
This [gulp](http://gulpjs.com/) plugin is wrapper of [htmlclean](https://github.com/anseki/htmlclean).
* [Grunt](http://gruntjs.com/) plugin: [grunt-htmlclean](https://github.com/anseki/grunt-htmlclean)
* [webpack](https://webpack.js.org/) loader: [htmlclean-loader](https://github.com/anseki/htmlclean-loader)**If you want to just clean files, [Command Line Tool](https://github.com/anseki/htmlclean-cli) is easy way.**
Simple and safety HTML/SVG cleaner to minify without changing its structure.
See [htmlclean](https://github.com/anseki/htmlclean) for options and more information about htmlclean.## Getting Started
```shell
npm install gulp-htmlclean --save-dev
```## Usage
`gulpfile.js`
```js
var gulp = require('gulp'),
htmlclean = require('gulp-htmlclean');gulp.task('default', function() {
return gulp.src('./develop/*.html')
.pipe(htmlclean({
protect: /<\!--%fooTemplate\b.*?%-->/g,
edit: function(html) { return html.replace(/\begg(s?)\b/ig, 'omelet$1'); }
}))
.pipe(gulp.dest('./public_html/'));
});
```See [htmlclean](https://github.com/anseki/htmlclean#options) for the options.