{"id":13775298,"url":"https://github.com/leogr/rollup-plugin-html-entry","last_synced_at":"2025-05-11T07:32:19.735Z","repository":{"id":18506684,"uuid":"84477103","full_name":"leogr/rollup-plugin-html-entry","owner":"leogr","description":"Use HTML files as entry points in your rollup bundle.","archived":true,"fork":false,"pushed_at":"2022-02-11T21:54:10.000Z","size":671,"stargazers_count":13,"open_issues_count":7,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-22T15:07:58.799Z","etag":null,"topics":["bundle","html-imports","rollup-plugin","webcomponents"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leogr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T18:49:22.000Z","updated_at":"2023-08-17T20:59:41.000Z","dependencies_parsed_at":"2022-08-07T09:00:46.185Z","dependency_job_id":null,"html_url":"https://github.com/leogr/rollup-plugin-html-entry","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leogr%2Frollup-plugin-html-entry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leogr%2Frollup-plugin-html-entry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leogr%2Frollup-plugin-html-entry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leogr%2Frollup-plugin-html-entry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leogr","download_url":"https://codeload.github.com/leogr/rollup-plugin-html-entry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253533953,"owners_count":21923515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","html-imports","rollup-plugin","webcomponents"],"created_at":"2024-08-03T17:01:36.606Z","updated_at":"2025-05-11T07:32:19.419Z","avatar_url":"https://github.com/leogr.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Workflow"],"readme":"[![Build Status](https://img.shields.io/travis/leogr/rollup-plugin-html-entry.svg?style=flat-square)](https://travis-ci.org/leogr/rollup-plugin-html-entry)\n\n# rollup-plugin-html-entry\n\nUse HTML files as entry points in your [rollup](https://github.com/rollup/rollup) bundle.\nHTML files and [HTML imports](https://www.w3.org/TR/html-imports/) will be traversed, then all scripts found will be combined.\nOptionally, write HTML files cleaned of `\u003cscript\u003e`s.\nThis is particularly useful for [web components](https://www.webcomponents.org/introduction) and web applications in general.\n\n```html\n\u003c!-- 0.html --\u003e\n\u003cscript\u003eexport const zero = 0;\u003c/script\u003e\n```\n\n```html\n\u003c!-- 1.html --\u003e\n\u003cscript\u003eexport const one = 1;\u003c/script\u003e\n```\n\n```html\n\u003c!-- 2.html --\u003e\n\u003cscript src=\"2.js\"\u003e\u003c/script\u003e\n```\n\n```js\n// 2.js\nexport const two = 2;\n```\n\n```html\n\u003c!-- all-imports.html --\u003e\n\u003clink rel=\"import\" href=\"0.html\"\u003e\n\u003clink rel=\"import\" href=\"1.html\"\u003e\n\u003clink rel=\"import\" href=\"2.html\"\u003e\n\n```\n\nUsing `all-imports.html` as entry point will yield a bundle with exports for `zero`, `one`, and `two`.\n\nSo, this plugin works like [rollup-plugin-multi-entry](https://github.com/rollup/rollup-plugin-multi-entry) does, but using `\u003cscript\u003e`s contained in HTML files as entry points.\n\n## Install\n\n```\n$ npm install [--save-dev] rollup-plugin-html-entry\n```\n\n## Usage\n\nThis plugin requires at least v0.48.0 of rollup. In `rollup.config.js`:\n\n```js\nimport htmlEntry from 'rollup-plugin-html-entry';\n\nexport default {\n  input: 'test/**/*.html',\n  plugins: [htmlEntry()]\n};\n```\n\nThe `input` above is the simplest form which simply takes a glob string.\nYou may pass an array of glob strings or an object with one or more of the following options:\n\n```js\nexport default {\n  input: {\n    // Arrays of globs to include\n    include: ['index.html', 'and/globs/**/*.html'],\n    // Arrays of globs to exclude\n    exclude: ['excluded-file.html', 'and/globs/*.to.be.excluded.html'],\n    // Arrays of globs that should remain external to the bundle\n    external: ['lazy-imports.html', 'and/globs/*.to.be.omitted.html']\n  }\n  // ...\n};\n\n```\n\nBy default HTML files will be not written. If `output` option is present, HTML files stripped of `\u003cscript\u003e`s will be written into specified path.\n\n```js\nexport default {\n  input: 'index.html',\n  plugins: [htmlEntry({ output: \"build\" })]\n  // ...\n};\n```\n\nFinally, you may not need to export anything from the rolled-up bundle for web applications. In\nsuch cases, use the `exports: false` option like so:\n\n```js\nexport default {\n  input: 'index.html',\n  plugins: [htmlEntry({ exports: false })]\n};\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleogr%2Frollup-plugin-html-entry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleogr%2Frollup-plugin-html-entry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleogr%2Frollup-plugin-html-entry/lists"}