🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@parcel/optimizer-htmlnano

Package Overview
Dependencies
Maintainers
1
Versions
930
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/optimizer-htmlnano

2.7.0
Source
npm
Version published
Weekly downloads
279K
-3.29%
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 03 Aug 2022

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