Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huanz/browserify-html
Simple HTML transform for Browserify
https://github.com/huanz/browserify-html
Last synced: about 6 hours ago
JSON representation
Simple HTML transform for Browserify
- Host: GitHub
- URL: https://github.com/huanz/browserify-html
- Owner: huanz
- Created: 2018-02-27T11:28:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-02-27T12:07:05.000Z (over 6 years ago)
- Last Synced: 2024-11-04T00:29:35.437Z (15 days ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# browserify-html [![browserify-html](https://img.shields.io/npm/v/browserify-html.svg?style=flat-square)](https://www.npmjs.com/package/browserify-html)
Simple HTML transform for Browserify
```bash
npm i browserify-html
```## Options
- exts - default: `['html', 'tpl']`
- minify - default: `{removeComments: true, collapseWhitespace: true, collapseBooleanAttributes: true, removeRedundantAttributes: true, removeEmptyAttributes: true}`, see [html-minifier](https://github.com/kangax/html-minifier#options-quick-reference)## Usage
```javascript
const html = require('browserify-html');
```### Browserify Middleware
```javascript
const bunlde = browserify()
.transform(html, {
exts: ['html', 'tpl'], // default
minify: { // html-minifier options, see more: https://github.com/kangax/html-minifier#options-quick-reference
removeComments: true,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeRedundantAttributes: true,
removeEmptyAttributes: true
}
});
```### Gulp and Browserify
```javascript
gulp.task('js', () => {
return gulp.src('./src/js/app.js')
.pipe(browserify({
transform: html
}))
.pipe(gulp.dest('./dist/js'));
});
```