Browserify transform that converts HTML files into JavaScript modules by generating a JS string from the HTML content. Version 1.3.0 is the latest stable release. It integrates with Browserify's transform pipeline, allowing HTML files to be required as strings in Node.js/browser code. Supports optional minification via html-minifier. Differentiates from other HTML require transforms by its simple pass-through of options to html-minifier.
npm install html2js-browserifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to require an HTML file after applying the Browserify transform.
Ensure browserify runs with -t html2js-browserify or set in package.json
Use a modern bundler or switch to import HTML as a raw string
Pass all html-minifier options after --minify
Run browserify with -t html2js-browserify or set transform in package.json
Verify the transform is correctly registered and browserify is run with the transform flag