{"id":27355,"library":"rollup-plugin-generate-html","title":"rollup-plugin-generate-html","description":"Rollup plugin to generate an HTML file that includes the bundle script. Works with Rollup's output to insert script tags into a template, optionally inline the bundle. Version 0.2.0 targets Node >=8.3. Abandoned – last commit in 2019, no releases since. Simpler than rollup-plugin-html but lacks features like asset injection or multi-page support.","status":"abandoned","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/vladshcherbin/rollup-plugin-generate-html","tags":["javascript","rollup","rollup-plugin","generate","html","template"],"install":[{"cmd":"npm install rollup-plugin-generate-html","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-generate-html","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-generate-html","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for Rollup plugin interface","package":"rollup","optional":false}],"imports":[{"note":"Default export only; no named export. ESM only, no CJS wrapper.","wrong":"const generateHtml = require('rollup-plugin-generate-html')","symbol":"generateHtml","correct":"import generateHtml from 'rollup-plugin-generate-html'"},{"note":"Named import of default does not work; must use default import or alias.","wrong":"import { generateHtml } from 'rollup-plugin-generate-html'","symbol":"generateHtml (as named)","correct":"import { default as generateHtml } from 'rollup-plugin-generate-html'"},{"note":"Any default import works; name not enforced.","wrong":"","symbol":"default import with different name","correct":"import genHtml from 'rollup-plugin-generate-html'"}],"quickstart":{"code":"// rollup.config.js\nimport generateHtml from 'rollup-plugin-generate-html'\n\nexport default {\n  input: 'src/index.js',\n  output: { file: 'dist/bundle.js', format: 'iife' },\n  plugins: [\n    generateHtml({\n      filename: 'dist/index.html'\n    })\n  ]\n}","lang":"javascript","description":"Basic setup to generate an HTML file that includes the bundle script via Rollup."},"warnings":[{"fix":"Set output.file to a single file; plugin does not support code splitting or multiple outputs.","message":"The plugin generates HTML after the bundle is written, requiring the output file to be present. Ensure output.file is set, not output.dir.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Avoid inline with dynamic imports or use with simple IIFE bundles.","message":"The inline option does not support code splitting; all chunks are inlined into a single script tag. May cause issues with dynamic imports.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use path.resolve(__dirname, 'template.html') for robust path resolution.","message":"The template option expects a path to a file relative to the current working directory, not relative to the config file. Absolute paths recommended.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consider alternatives like @rollup/plugin-html or rollup-plugin-html2.","message":"The plugin is effectively abandoned; no updates since 2019. May not work with Rollup >=2.x (uses deprecated plugin API).","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure the template path is correct and accessible from the current working directory. Use an absolute path.","cause":"Template file path is incorrect or file does not exist.","error":"Error: Could not resolve 'template' option"},{"fix":"Use import generateHtml from 'rollup-plugin-generate-html' (default import).","cause":"Importing wrong symbol; plugin exports default only.","error":"TypeError: generateHtml is not a function"},{"fix":"Run npm install -D rollup-plugin-generate-html and ensure package.json includes it.","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'rollup-plugin-generate-html'"},{"fix":"Set output.file to a single bundle file; this plugin does not support code splitting.","cause":"Plugin requires output.file to be set, not output.dir.","error":"Error: Failed to generate HTML: output option must be a single file"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}