An esbuild plugin that generates an HTML file with output URLs of bundled assets. Version 1.1.0, released as stable. It provides fine-grained control over HTML head and body elements through callback functions, allowing dynamic injection of CSS and JS references. Unlike alternative HTML plugins for esbuild, this one is minimalistic and avoids bundling HTML templates, focusing solely on generating a simple HTML file with asset URLs. No HTML minification is included since v1.1.0. The package is ESM-only, small, and has no runtime dependencies.
npm install esbuild-html-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds an esbuild bundle and generates an index.html with script tags for JS outputs.
Remove any minification options. If needed, use a separate minification step.
Change import to named export.
Ensure outfile is set and esbuild's outdir or outfile is configured.
Handle URLs as provided; use publicPath to control prefix.
Run 'npm install esbuild-html-plugin' and use 'import' syntax.
Change to 'import { htmlPlugin } from 'esbuild-html-plugin''.Ensure htmlPlugin is called: htmlPlugin({ outfile: 'index.html' }).No dependency data recorded yet.