Socket
Socket
Sign inDemoInstall

@parcel/transformer-html

Package Overview
Dependencies
Maintainers
1
Versions
868
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/transformer-html


Version published
Maintainers
1
Created

What is @parcel/transformer-html?

@parcel/transformer-html is a plugin for the Parcel bundler that allows you to transform HTML files. It can handle various tasks such as injecting assets, processing inline scripts and styles, and more.

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

Injecting Assets

Automatically injects CSS and JS assets into the HTML file. This is useful for ensuring that all necessary assets are included in the final build.

<!DOCTYPE html>
<html>
<head>
  <title>My App</title>
  <link rel="stylesheet" href="./styles.css">
</head>
<body>
  <script src="./index.js"></script>
</body>
</html>

Processing Inline Scripts and Styles

Processes inline scripts and styles, allowing you to write them directly in your HTML files. This can be useful for small scripts and styles that don't need to be in separate files.

<!DOCTYPE html>
<html>
<head>
  <style>
    body { background-color: #f0f0f0; }
  </style>
</head>
<body>
  <script>
    console.log('Hello, world!');
  </script>
</body>
</html>

Minification

Minifies the HTML, CSS, and JS to reduce the size of the final output. This helps in improving the load time of the web application.

<!DOCTYPE html>
<html>
<head>
  <title>My App</title>
  <link rel="stylesheet" href="./styles.css">
</head>
<body>
  <script src="./index.js"></script>
</body>
</html>

Other packages similar to @parcel/transformer-html

FAQs

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