Registry / devops / rollup-plugin-html-scaffold

rollup-plugin-html-scaffold

JSON →
library0.2.0jsnpmunverified

Rollup plugin for generating HTML files from templates with placeholder injection. Current stable version: 0.2.0. Low release cadence (last release Feb 2019). Replaces simple HTML template processing within Rollup builds, allowing dynamic substitution of placeholders like <%= appName %>. Compared to alternatives like @rollup/plugin-html or html-webpack-plugin, this plugin offers minimalistic template support without additional features like asset hashing or minification. Requires Rollup >=1.1.2.

npm install rollup-plugin-html-scaffold
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-HTML
R
rollup-plugin-html-scaffold
devopsjavascriptv0.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import html from 'rollup-plugin-html-scaffold'
import { html } from 'rollup-plugin-html-scaffold'
The package uses default export. Named import will result in undefined.
default
const html = require('rollup-plugin-html-scaffold').default
const html = require('rollup-plugin-html-scaffold')
CommonJS require must access .default property due to ESM interop.
HtmlOptions
import type { HtmlOptions } from 'rollup-plugin-html-scaffold'
TypeScript users can import the options interface for type checking.

Shows typical usage: importing the plugin, configuring template placeholders, and generating an HTML file from a template with Rollup build.

// rollup.config.js import html from 'rollup-plugin-html-scaffold'; import { defineConfig } from 'rollup'; export default defineConfig({ input: 'src/index.js', output: { dir: 'dist', format: 'es', }, plugins: [ html({ input: 'src/index.html', output: 'dist/index.html', template: { 'title': 'My App', 'bundle': 'bundle.js', }, }), ], }); // src/index.html <!doctype html><html><head><title><%= title %></title></head><body><script src="<%= bundle %>"></script></body></html>
Debug
Known issues
gotchaThe plugin does not handle Rollup's asset emission. Generated HTML file is written directly to disk, not through Rollup's output system. This can cause issues if output directory is cleaned or if multiple outputs are used.
fix
Ensure the output path is relative to project root, and consider using @rollup/plugin-html or rollup-plugin-generate-html for better integration.
affects: >=0.1.0
gotchaTemplate placeholders use ERB-style delimiters (<%= %>). If your HTML contains similar patterns (e.g., in JS templates), they will be incorrectly parsed.
fix
Escape literal '<%=' sequences by using a placeholder like '&lt;%=' in the template or choose a different plugin.
affects: >=0.1.0
deprecatedThe package has not been updated since February 2019 and uses outdated Rollup plugin API (pre-2.0). It may not work with Rollup 3+.
fix
Upgrade to Rollup 2 last supported version or switch to maintained alternatives like @rollup/plugin-html or rollup-plugin-html2.
affects: >=0.1.0
gotchaThe plugin does not minify or inject hashed filenames. For production, you need additional plugins or manual configuration.
fix
Use rollup-plugin-replace or @rollup/plugin-replace to inject hashed filenames, or choose a more feature-rich HTML plugin.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-html-scaffold'
The package is not installed or not present in node_modules.
fix
Run 'npm install rollup-plugin-html-scaffold --save-dev' or 'yarn add rollup-plugin-html-scaffold --dev'.
TypeError: html is not a function
Wrong import style: using named import instead of default import.
fix
Change to 'import html from 'rollup-plugin-html-scaffold'' (default import) or use 'const html = require('rollup-plugin-html-scaffold').default'.
Error: Input HTML file not found: src/index.html
The 'input' option path is incorrect or file doesn't exist.
fix
Verify that 'input' points to an existing HTML file relative to the project root.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
rolluprequiredPeer dependency: plugin requires Rollup >=1.1.2 to function as a plugin.
Agent activity
5 hits · last 30 days
node
4
Resources
rollup-plugin-html-scaffold — npm install rollup-plugin-html-scaffold · libregistry