{"id":22058,"library":"rollup-plugin-html-scaffold","title":"rollup-plugin-html-scaffold","description":"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.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/mario-aleo/rollup-plugin-html-scaffold","tags":["javascript","rollup","rollup-plugin","html","scaffold","template","injection"],"install":[{"cmd":"npm install rollup-plugin-html-scaffold","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-html-scaffold","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-html-scaffold","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: plugin requires Rollup >=1.1.2 to function as a plugin.","package":"rollup","optional":false}],"imports":[{"note":"The package uses default export. Named import will result in undefined.","wrong":"import { html } from 'rollup-plugin-html-scaffold'","symbol":"default","correct":"import html from 'rollup-plugin-html-scaffold'"},{"note":"CommonJS require must access .default property due to ESM interop.","wrong":"const html = require('rollup-plugin-html-scaffold')","symbol":"default","correct":"const html = require('rollup-plugin-html-scaffold').default"},{"note":"TypeScript users can import the options interface for type checking.","wrong":null,"symbol":"HtmlOptions","correct":"import type { HtmlOptions } from 'rollup-plugin-html-scaffold'"}],"quickstart":{"code":"// rollup.config.js\nimport html from 'rollup-plugin-html-scaffold';\nimport { defineConfig } from 'rollup';\n\nexport default defineConfig({\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'es',\n  },\n  plugins: [\n    html({\n      input: 'src/index.html',\n      output: 'dist/index.html',\n      template: {\n        'title': 'My App',\n        'bundle': 'bundle.js',\n      },\n    }),\n  ],\n});\n\n// src/index.html\n<!doctype html><html><head><title><%= title %></title></head><body><script src=\"<%= bundle %>\"></script></body></html>","lang":"javascript","description":"Shows typical usage: importing the plugin, configuring template placeholders, and generating an HTML file from a template with Rollup build."},"warnings":[{"fix":"Ensure the output path is relative to project root, and consider using @rollup/plugin-html or rollup-plugin-generate-html for better integration.","message":"The 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.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Escape literal '<%=' sequences by using a placeholder like '&lt;%=' in the template or choose a different plugin.","message":"Template placeholders use ERB-style delimiters (<%= %>). If your HTML contains similar patterns (e.g., in JS templates), they will be incorrectly parsed.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade to Rollup 2 last supported version or switch to maintained alternatives like @rollup/plugin-html or rollup-plugin-html2.","message":"The package has not been updated since February 2019 and uses outdated Rollup plugin API (pre-2.0). It may not work with Rollup 3+.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Use rollup-plugin-replace or @rollup/plugin-replace to inject hashed filenames, or choose a more feature-rich HTML plugin.","message":"The plugin does not minify or inject hashed filenames. For production, you need additional plugins or manual configuration.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install rollup-plugin-html-scaffold --save-dev' or 'yarn add rollup-plugin-html-scaffold --dev'.","cause":"The package is not installed or not present in node_modules.","error":"Error: Cannot find module 'rollup-plugin-html-scaffold'"},{"fix":"Change to 'import html from 'rollup-plugin-html-scaffold'' (default import) or use 'const html = require('rollup-plugin-html-scaffold').default'.","cause":"Wrong import style: using named import instead of default import.","error":"TypeError: html is not a function"},{"fix":"Verify that 'input' points to an existing HTML file relative to the project root.","cause":"The 'input' option path is incorrect or file doesn't exist.","error":"Error: Input HTML file not found: src/index.html"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}