Webpack plugin (v3.0.2, latest) for rendering static HTML files using JavaScript, designed for multi-config webpack builds. Supports code-splitting, dynamic imports, and asset injection from separate webpack compilation stats. Differentiates from html-webpack-plugin by supporting multiple configurations (e.g., one for browser assets, one for node rendering) and allowing custom render functions with access to webpack stats. Requires webpack 5 (v3.x) and express as a peer dependency. Active development with recent maintenance updates.
npm install html-render-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Shows a minimal single-config setup for html-render-webpack-plugin with a render function entry.
Use `const { HtmlRenderPlugin } = require('html-render-webpack-plugin');`Upgrade to webpack 5 or use v2.x (html-render-webpack-plugin@2)
Create an instance and use `.rendererPlugin` for the rendering config, `.statsCollectorPlugin` for stats collection in other configs.
Run `npm install express` or add it to your project dependencies.
Use `new HtmlRenderPlugin().rendererPlugin` instead.
Run `npm install html-render-webpack-plugin`.
Change `const HtmlRenderPlugin = require('html-render-webpack-plugin')` to `const { HtmlRenderPlugin } = require('html-render-webpack-plugin')`.Create separate instances for each config or use .statsCollectorPlugin for additional configs.
Add `htmlRenderPlugin.statsCollectorPlugin` to the client config's plugins list.