A webpack plugin that injects script tags and CSS links into HTML files using placeholder comments. Version 1.0.1 is the latest stable release. It provides an alternative to html-webpack-plugin with customizable injection markers, support for chunk-based asset injection, custom content injection, and transducer functions for CDN URL rewriting. Notable differentiators include simpler configuration via HTML comments and lower overhead.
npm install inject-html-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Configures InjectHtmlPlugin to inject script and CSS links into an HTML file with CDN transducer and custom timestamp injection.
Ensure the HTML file specified by 'filename' exists in the output path before running webpack.
Use same string as in entry configuration, e.g., entry: { index: './src/index.js' } → chunks: ['index'].Ensure transducer string ends with '/' if used as URL base, or provide a function that handles path concatenation.
Manually escape HTML special characters if needed.
Consider migrating to html-webpack-plugin for better support and features.
npm install inject-html-webpack-plugin --save-dev
Use require() instead: const InjectHtmlPlugin = require('inject-html-webpack-plugin');Ensure the HTML file exists at the specified path, or update 'filename' accordingly.
Check options object for misspellings (e.g., 'filname' instead of 'filename') and ensure only valid keys: filename, chunks, transducer, etc.
No dependency data recorded yet.