
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
esbuild-plugin-minify-html
Advanced tools
esbuild plugin for importing html files as minified raw text.
esbuild plugin for importing html files as minified raw text.
It uses html-minifier-terser to minify the html.
// index.js
import appHTML from "./app.html?raw";
console.log(appHTML);
// build.js
import esbuild from "esbuild";
import minifyHTML from "esbuild-plugin-minify-html";
esbuild.build({
entryPoints: ["index.js"],
bundle: true,
outfile: "out.js",
plugins: [
minifyHTML({
// optional html-minifier-terser options
collapseWhitespace: true,
}),
],
});
Add type declaration for *.html?raw
in your project.
declare module "*.html?raw" {
const src: string;
export default src;
}
This is a fork of esbuild-plugin-raw-css.
FAQs
esbuild plugin for importing html files as minified raw text.
The npm package esbuild-plugin-minify-html receives a total of 60 weekly downloads. As such, esbuild-plugin-minify-html popularity was classified as not popular.
We found that esbuild-plugin-minify-html 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.