rollup-plugin-html-entry

raw JSON →
0.3.0 verified Mon Apr 27 auth: no javascript maintenance

Use HTML files as entry points in Rollup bundles (v0.3.0, last release 2018-04-06, maintenance mode). Traverses HTML files and HTML imports, combining all scripts found, with optional output of HTML files stripped of <script> tags. Similar to rollup-plugin-multi-entry but for HTML-based entry. Requires Rollup >=0.48.0. Not actively maintained; consider alternatives.

error Error: Could not resolve entry module
cause Input path is not a valid glob or does not match any HTML files.
fix
Check input glob pattern. Use absolute paths or relative from project root. Example: input: 'src/**/index.html'
error TypeError: plugin is not a function
cause Incorrect import of plugin (e.g., using destructured import).
fix
Use default import: import htmlEntry from 'rollup-plugin-html-entry';
gotcha Package is in maintenance mode; last update 2018. May not work with Rollup >=2.0.
fix Consider alternatives like @web/rollup-plugin-html or custom HTML processing.
gotcha HTML imports (<link rel="import">) are deprecated by Chrome and not supported in other browsers.
fix Use ES modules or importmap instead of HTML imports.
deprecated Rollup 0.x plugins often use deprecated APIs; plugin may not work with Rollup 1.x or 2.x.
fix Use Rollup 0.48-0.68 or migrate to a modern rollup-html plugin.
gotcha Only <script> with text content or src attribute are processed; inline event handlers and script type="module" are ignored.
fix Place all script code in separate files or inline within <script> tags (no module type).
npm install rollup-plugin-html-entry
yarn add rollup-plugin-html-entry
pnpm add rollup-plugin-html-entry

Rollup configuration using rollup-plugin-html-entry with include/exclude/external globs, output dir for cleaned HTML, and exports:false.

// rollup.config.js
import htmlEntry from 'rollup-plugin-html-entry';

export default {
  input: 'src/**/*.html',
  plugins: [
    htmlEntry({
      include: ['src/**/*.html'],
      exclude: ['src/excluded.html'],
      external: ['src/lazy.html'],
      output: 'dist',
      exports: false
    })
  ],
  output: {
    dir: 'dist',
    format: 'esm'
  }
};