A Webpack plugin (v1.3.0, latest) that injects a custom HTML string into the <body> of html-webpack-plugin output. Released under MIT, updated irregularly. Unlike generic string-replacement plugins, it integrates directly with html-webpack-plugin's compilation hooks, supporting position (start/end) and custom content. Requires html-webpack-plugin ^5.3.1 as a peer dependency. Ships TypeScript types for full IDE support.
npm install inject-body-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Shows basic usage: import the plugin, instantiate with content string, and add to Webpack plugins array alongside HtmlWebpackPlugin.
Remove 'port' from options; it is no longer supported.
Ensure html-webpack-plugin version 4+ is installed.
Default content changed in 1.3.0; specify 'content' explicitly for consistent behavior.
Order plugins so that HtmlWebpackPlugin appears first.
Sanitize any user-provided content before passing to the plugin.
Use `import InjectBodyPlugin from 'inject-body-webpack-plugin'` (no braces).
Run `npm install --save-dev html-webpack-plugin`.
Upgrade html-webpack-plugin to version 4 or higher.