{"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,"search_vec":"'0.2.0':35 '2019':43 '8.3':38 'abandon':39 'asset':57 'bundl':16,33 'commit':41 'featur':55 'file':12 'generat':4,9,69 'html':5,11,52,70 'includ':14 'inject':58 'inlin':31 'insert':24 'javascript':64 'lack':54 'last':40 'like':56 'multi':61 'multi-pag':60 'node':37 'option':30 'output':22 'page':62 'plugin':3,7,51,68 'releas':45 'rollup':2,6,20,50,65,67 'rollup-plugin':66 'rollup-plugin-generate-html':1 'rollup-plugin-html':49 'script':17,25 'simpler':47 'sinc':46 'support':63 'tag':26 'target':36 'templat':29,71 'version':34 'work':18","created_at":"2026-05-01T17:45:49.500355+00:00","updated_at":"2026-05-01T17:45:49.500355+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/vladshcherbin/rollup-plugin-generate-html","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-generate-html","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-27","next_check":"2026-07-26","install_tag":null}}