Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sapics/html-minifier-loader
Webpack loader which minifies HTML by html-minifier
https://github.com/sapics/html-minifier-loader
html-minifier webpack-loader
Last synced: 3 months ago
JSON representation
Webpack loader which minifies HTML by html-minifier
- Host: GitHub
- URL: https://github.com/sapics/html-minifier-loader
- Owner: sapics
- License: mit
- Created: 2015-09-05T01:14:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-14T05:29:31.000Z (over 6 years ago)
- Last Synced: 2024-09-17T03:34:39.530Z (3 months ago)
- Topics: html-minifier, webpack-loader
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 7
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html-minifier-loader [![NPM version](https://badge.fury.io/js/html-minifier-loader.svg)](https://badge.fury.io/js/html-minifier-loader)
Webpack loader that minifies HTML by [html-minifier](https://github.com/kangax/html-minifier).
Installation
---
```console
npm install html-minifier html-minifier-loader --save
```Example of webpack.config.js
---
You can pass [html-minifier](https://github.com/kangax/html-minifier) parameters by 'html-minifier-loader' property.
The default is `{removeComments: true, collapseWhitespace: true}`.
```js
module: {
loaders: [
{ test: /\.html$/,
loader: 'raw-loader!html-minifier-loader'
}
]
},
'html-minifier-loader': {
removeComments: false,
collapseWhitespace: true,
conservativeCollapse: true,
preserveLineBreaks: true
}
```