Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/optimizer-htmlnano

Package Overview
Dependencies
Maintainers
1
Versions
881
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/optimizer-htmlnano

  • 2.0.0-nightly.185
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
237K
decreased by-4.51%
Maintainers
1
Weekly downloads
 
Created

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

Package last updated on 28 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc