Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hypernova7/html-beautifier-webpack-plugin
https://github.com/hypernova7/html-beautifier-webpack-plugin
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hypernova7/html-beautifier-webpack-plugin
- Owner: hypernova7
- License: mit
- Created: 2021-01-24T04:40:54.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-10T15:26:14.000Z (almost 2 years ago)
- Last Synced: 2023-03-05T12:42:45.918Z (over 1 year ago)
- Language: JavaScript
- Size: 46.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html-beautify-webpack-plugin
Beautifier for output of [HtmlWebpackPlugin](https://github.com/jantimon/html-webpack-plugin)Installation
------------
Install the plugin with npm:
```shell
$ npm i -D html-beautify-webpack-plugin
```Usage
-----------```javascript
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlBeautifyPlugin = require('html-beautify-webpack-plugin');...
plugins: [
new HtmlWebpackPlugin()
new HtmlBeautifyPlugin()
]
...
``````javascript
...
plugins: [
new HtmlWebpackPlugin()
new HtmlBeautifyPlugin({
config: {
html: {
end_with_newline: true,
indent_size: 2,
indent_with_tabs: true,
indent_inner_html: true,
preserve_newlines: true,
unformatted: ['p', 'i', 'b', 'span']
}
},
replace: [ ' type="text/javascript"' ]
})
]
...
```Order is important
Configuration
-------------
You can pass a configuration options.
Allowed values are as follows:- `config`: `{...}` [js-beautify](https://github.com/beautify-web/js-beautify)'s options as object to beatify the output.
- `replace`: `[string | { test: (string | RegExp), with?: (string | func)}]` Optional array of items to replace in destination file