A webpack loader that minifies HTML templates inside JavaScript/TypeScript template string literals used by lit-html and similar libraries. Version 1.0.0 is the initial stable release. It is designed to be chained after a TypeScript or JavaScript loader to reduce the size of tagged template literals containing HTML. The loader processes .ts or .js files, minifying the HTML content within template literals using HTML minification techniques. It supports optional debug mode and integrates seamlessly into webpack builds. Compared to alternatives like babel-plugin-template-html-minifier, this works as a webpack loader and is easier to set up in webpack projects.
npm install lit-html-minifier-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures webpack to run lit-html-minifier-loader after ts-loader on .element.ts files, minifying HTML in template literals.
Ensure lit-html-minifier-loader comes after ts-loader in the 'use' array.
Adjust the test pattern to match your desired files: /\.ts$/ or other regex.
Check source code or use package with minimal configuration.
Run 'npm install -D lit-html-minifier-loader'
Run 'npm install html-minifier' alongside the loader.
Upgrade webpack to version 5 or later.
No dependency data recorded yet.