A Rollup plugin that imports HTML files as JavaScript string variables. Version 0.2.1 is the latest stable release, though the project appears to be in maintenance mode with no recent updates. It uses rollup-pluginutils for file filtering and integrates with html-minifier for optional minification. Differentiators: simple API, support for include/exclude glob patterns, and opt-in HTML minification via html-minifier options. Alternatives like @rollup/plugin-html or vite-plugin-html offer more features.
npm install rollup-plugin-htmlVerified import paths — ran on the pinned version, not inferred.
Shows how to configure rollup-plugin-html in a rollup config and import an HTML file as a string.
Consider migrating to @rollup/plugin-html or use vite-plugin-html for modern builds.
Use a separate plugin for SVG or XML imports.
Ensure options match html-minifier documentation.
Set include option to include node_modules: include: ['**/*.html', 'node_modules/**/*.html']
Run npm install --save-dev rollup-plugin-html and ensure correct import syntax.
Use import html from 'rollup-plugin-html' rather than import { html } from 'rollup-plugin-html'.Add html() to the plugins array in rollup.config.js.