$ show webdiscus/html-bundler-webpack-plugin
html-bundler-webpack-plugin is a webpack plugin that processes HTML templates and bundles associated assets (CSS, JS, images, etc.) into output HTML files. It treats HTML as a webpack entry point, resolves dependencies via webpack's module system, and updates asset references to hashed output URLs. The plugin supports multiple template engines (Pug, Handlebars, EJS, Nunjucks, etc.), asset inlining, subresource integrity, hot module replacement, and code splitting. Architecture consists of a main plugin class, loader infrastructure, and modular preprocessors. It integrates with webpack's compilation hooks for asset extraction and HTML modification. Examples demonstrate usage with frameworks like React, Vue, and CSS tools like TailwindCSS.
The LLM identified 3 files worth highlighting for reuse:
Parses query strings and JSON5 objects, supporting special values (true/false/null) and array notation. Self-contained utility for extended URL/query parsing, decoupled from webpack internals.
Iterable wrapper over WeakMap enabling safe iteration while allowing garbage collection of keys. Reusable caching pattern demonstrating clean resource management.
File system utilities for reading files, resolving paths, and checking existence. Generic IO helpers that could be extracted for use in any Node.js project.