html-beautifier-webpack-plugin
v1.0.6
Published
Beautify output of HtmlWebpackPlugin
Downloads
671
Maintainers
Readme
html-beautifier-webpack-plugin
Beautify output of HtmlWebpackPlugin
Installation
Install the plugin with npm:
$ npm i -D html-beautifier-webpack-plugin
Usage
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlBeautifierPlugin = require('html-beautifier-webpack-plugin');
plugins: [
new HtmlWebpackPlugin()
new HtmlBeautifierPlugin()
]
Configuration
You can pass a configuration options which is js-beautify's options. Default options for this package:
{
html: {
indent_size: 2,
end_with_newline: true,
indent_inner_html: true,
preserve_newlines: true,
max_preserve_newlines: 0,
wrap_line_length: 120,
extra_liners: [],
js: {
end_with_newline: false,
preserve_newlines: true,
max_preserve_newlines: 2,
space_after_anon_function: true
},
css: {
end_with_newline: false,
preserve_newlines: false,
newline_between_rules: false
}
}
}