Simplifies creation of HTML files to serve your Rspack bundles. This plugin is the Rspack equivalent of html-webpack-plugin, automatically injecting script and link tags into an HTML template. Current stable version is 6.1.9, released with support for Rspack core v1 and v2 (pre-release). It offers tight integration with Rspack's build system, supporting template engines, minification, and multi-page setups. The plugin is maintained actively by the Rspack team and provides a drop-in migration path from webpack to Rspack.
npm install html-rspack-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to add html-rspack-plugin to a Rspack config, specifying a custom HTML template and output filename.
Update to Node >= 16.20.2 and use ESM imports (import/export). If using CJS, use dynamic import() or require('html-rspack-plugin').default.Use `const HtmlRspackPlugin = require('html-rspack-plugin').default;`Install @rspack/core in your project (devDependency).
Refer to the official documentation for Rspack-compatible options.
Remove the compile option; use Rspack's built-in minification or a custom minifier plugin.
npm install html-rspack-plugin --save-dev
Use `const HtmlRspackPlugin = require('html-rspack-plugin').default;`Specify a single string path to your HTML template file.