Socket
Socket
Sign inDemoInstall

@parcel/optimizer-htmlnano

Package Overview
Dependencies
5
Maintainers
1
Versions
833
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/optimizer-htmlnano


Version published
Maintainers
1
Created

Package description

What is @parcel/optimizer-htmlnano?

@parcel/optimizer-htmlnano is a plugin for the Parcel bundler that optimizes HTML files using htmlnano. It helps in reducing the size of HTML files by minifying and compressing them, which can lead to faster load times and improved performance.

What are @parcel/optimizer-htmlnano's main functionalities?

Minification

This feature minifies HTML files by removing unnecessary whitespace, comments, and other redundant elements. The code sample shows how to include the @parcel/optimizer-htmlnano plugin in a Parcel configuration file.

module.exports = {
  plugins: [
    '@parcel/optimizer-htmlnano'
  ]
};

Compression

This feature compresses HTML files by collapsing whitespace and minifying inline CSS and JavaScript. The code sample demonstrates how to configure htmlnano options within a Parcel configuration file.

module.exports = {
  plugins: [
    '@parcel/optimizer-htmlnano'
  ],
  htmlnano: {
    collapseWhitespace: 'conservative',
    minifyCSS: true,
    minifyJS: true
  }
};

Removing Redundant Attributes

This feature removes redundant attributes from HTML tags, such as type="text/javascript" from script tags. The code sample shows how to enable this option in the htmlnano configuration.

module.exports = {
  plugins: [
    '@parcel/optimizer-htmlnano'
  ],
  htmlnano: {
    removeRedundantAttributes: true
  }
};

Other packages similar to @parcel/optimizer-htmlnano

FAQs

Last updated on 09 Mar 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc