
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
@parcel/optimizer-htmlnano
Advanced tools
@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.
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
}
};
html-minifier is a highly configurable HTML minifier that can be used to reduce the size of HTML files. It offers a wide range of options for minification, including removing comments, collapsing whitespace, and minifying inline CSS and JavaScript. Compared to @parcel/optimizer-htmlnano, html-minifier is a standalone tool that can be used outside of the Parcel ecosystem.
html-webpack-plugin is a plugin for Webpack that simplifies the creation of HTML files to serve your bundles. It can also minify HTML files using the html-minifier-terser library. While it provides similar HTML optimization features, it is designed to work within the Webpack ecosystem rather than Parcel.
gulp-htmlmin is a Gulp plugin that uses html-minifier to minify HTML files. It is suitable for projects that use Gulp as their build system. Like @parcel/optimizer-htmlnano, it offers various options for HTML minification, but it is tailored for use with Gulp rather than Parcel.
[2.7.0] - 2022-08-03
with
query param - DetailserrorRecovery
option in @parcel/transformer-css
- DetailsFAQs
Unknown package
The npm package @parcel/optimizer-htmlnano receives a total of 267,658 weekly downloads. As such, @parcel/optimizer-htmlnano popularity was classified as popular.
We found that @parcel/optimizer-htmlnano demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.