New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

netlify-plugin-minify-html

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netlify-plugin-minify-html

A plugin to add HTML minification as a post-processing optimisation in Netlify

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
90
decreased by-33.82%
Maintainers
1
Weekly downloads
 
Created
Source

Netlify Plugin - Minify HTML

This plugin adds the ability to minify the HTML generated by your build.

Note: Many SSGs support this as part of their own process so this might not always be necessary.

This plugin is agnostic to the tool being used to generate the markup, and acts purely on the markup it finds in .html files in the publish folder which Netlify is preparing to deploy to its CDN following as successful build.

Installation

To include this plugin in your site deployment:

1. Add the plugin as a dependency


# Add the plugin as a dependency of your build
npm i --s netlify-plugin-minify-html

2. Add the plugin and its options to your netlify.yaml

You can choose which deploy contexts will include the HTML minification with the targets option.

You can use the minifierOptions config array to pass option to the minifier. A full list of the available options are available from the html-minfier library

plugins:
  # Path to plugin. Can be local relative path or reference to node_modules
  - package: netlify-plugin-minify-html
    config:
      # Builds in which deploy contexts will get minified?
      # [production, deploy-preview, branch-deploy]
      targets:
        - production
        - deploy-preview
        - branch-deploy
      minifierOptions:
        - removeComments: false
        - removeEmptyElements: true

🚨 NOTE - Netlify Plugins are currently in private beta

At this time, this plugin will only be available to those participating in the private beta of Netlify Plugins.

If you would like access to the beta, you are very welcome to apply.

Keywords

FAQs

Package last updated on 06 Feb 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc