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

@parcel/transformer-posthtml

Package Overview
Dependencies
Maintainers
1
Versions
887
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/transformer-posthtml

  • 2.13.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @parcel/transformer-posthtml?

@parcel/transformer-posthtml is a Parcel transformer plugin that allows you to use PostHTML to transform HTML files. PostHTML is a tool for transforming HTML/XML with JavaScript plugins, enabling you to modify HTML structure, add or remove elements, and more.

What are @parcel/transformer-posthtml's main functionalities?

HTML Transformation

This feature allows you to transform HTML files using PostHTML plugins. By adding the transformer to your Parcel bundler configuration, you can apply various PostHTML plugins to modify your HTML files during the build process.

module.exports = function (bundler) {
  bundler.addAssetType('html', require.resolve('@parcel/transformer-posthtml'));
};

Custom PostHTML Plugins

You can add custom PostHTML plugins to the Parcel bundler configuration. This allows you to extend the functionality of the HTML transformation process by using custom plugins that perform specific tasks.

module.exports = function (bundler) {
  bundler.addAssetType('html', require.resolve('@parcel/transformer-posthtml'));
  bundler.addPostHTMLPlugin(require('posthtml-custom-plugin'));
};

HTML Minification

This feature allows you to minify HTML files using PostHTML plugins like 'posthtml-minifier'. By adding the minifier plugin to the configuration, you can reduce the size of your HTML files by removing unnecessary whitespace and comments.

module.exports = function (bundler) {
  bundler.addAssetType('html', require.resolve('@parcel/transformer-posthtml'));
  bundler.addPostHTMLPlugin(require('posthtml-minifier')({ collapseWhitespace: true }));
};

Other packages similar to @parcel/transformer-posthtml

FAQs

Package last updated on 25 Nov 2024

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