Socket
Socket
Sign inDemoInstall

html-beautify-webpack-plugin

Package Overview
Dependencies
55
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    html-beautify-webpack-plugin

Adapter for beautifyjs as webpack plugin, chained with HtmlWebpackPlugin


Version published
Weekly downloads
205
decreased by-9.69%
Maintainers
1
Install size
2.88 MB
Created
Weekly downloads
 

Readme

Source

html-beautify-webpack-plugin

Beautifier for output of HtmlWebpackPlugin

Installation

Install the plugin with npm:

$ npm i -D html-beautify-webpack-plugin

Usage

const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlBeautifyPlugin = require('html-beautify-webpack-plugin');

...
    plugins: [
        new HtmlWebpackPlugin()
        new HtmlBeautifyPlugin()
    ]
...
...
    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'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

Keywords

FAQs

Last updated on 05 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc