{"id":14964170,"url":"https://github.com/serkodev/nuxt-single-html","last_synced_at":"2025-09-30T19:31:00.319Z","repository":{"id":253799927,"uuid":"843477337","full_name":"serkodev/nuxt-single-html","owner":"serkodev","description":"Build a Nuxt app into a single HTML file.","archived":false,"fork":false,"pushed_at":"2025-03-11T07:47:30.000Z","size":411,"stargazers_count":18,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T14:52:02.632Z","etag":null,"topics":["dx","javascript","nuxt","rollup","single-html","vite","vue"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serkodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-16T15:46:52.000Z","updated_at":"2025-09-17T06:24:16.000Z","dependencies_parsed_at":"2024-08-19T16:47:53.453Z","dependency_job_id":"132316fc-7515-4265-91db-892f0ef1ff81","html_url":"https://github.com/serkodev/nuxt-single-html","commit_stats":null,"previous_names":["serkodev/nuxt-single-html"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/serkodev/nuxt-single-html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fnuxt-single-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fnuxt-single-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fnuxt-single-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fnuxt-single-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serkodev","download_url":"https://codeload.github.com/serkodev/nuxt-single-html/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkodev%2Fnuxt-single-html/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277746958,"owners_count":25870057,"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","status":"online","status_checked_at":"2025-09-30T02:00:09.208Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dx","javascript","nuxt","rollup","single-html","vite","vue"],"created_at":"2024-09-24T13:32:41.066Z","updated_at":"2025-09-30T19:31:00.027Z","avatar_url":"https://github.com/serkodev.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# nuxt-single-html\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![License][license-src]][license-href]\n[![Nuxt][nuxt-src]][nuxt-href]\n\nBuild a Nuxt app into a single HTML file.\n\n## Features\n\n\u003c!-- Highlight some of the features your module provide here --\u003e\n- 📄 \u0026nbsp;Generates a fully self-contained HTML file for your Nuxt app.\n- 🚀 \u0026nbsp;Works out-of-the-box with zero configuration required for seamless setup.\n- 📦 \u0026nbsp;Supports inline JavaScript, CSS and images, etc.\n- ⚡ \u0026nbsp;SSG \u0026 SPA friendly, works with Nuxt Pages and multiple routes.\n- 🧩 \u0026nbsp;Achieve single HTML file generation by adjusting Nuxt config within a Nuxt module, no additional dependencies required.\n\n## Why?\n\nFor most websites, bundling your entire web application into a single file is generally NOT RECOMMENDED. However, in certain scenarios, this can be useful, such as:\n\n-\tIntegrating your web app within desktop or mobile WebView components\n-\tDeploying your web app to environments with strict access requirements\n-\tEmbedding your web app in embedded devices\n\nIn these special cases, `nuxt-single-html` allows you to leverage the powerful development experience of Nuxt while easily bundling your web app into a single HTML file, even supporting page pre-rendering.\n\nThis module is specifically designed to work with Nuxt. If you are looking for a similar solution for other frameworks, consider using [vite-plugin-singlefile](https://github.com/richardtallent/vite-plugin-singlefile).\n\n## Quickstart\n\nInstall the module to your Nuxt application with one command:\n\n```bash\nnpx nuxi module add nuxt-single-html\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eInstall manually\u003c/summary\u003e\n\n  ```sh\n  npm i -D nuxt-single-html\n  ```\n\n  ```ts\n  // nuxt.config.ts\n  export default defineNuxtConfig({\n    modules: ['nuxt-single-html']\n  })\n  ```\n\u003c/details\u003e\n\n### Generate single HTML\n\nAfter installing, you can now build your Nuxt app into a single HTML now, no configuration required. Since [`nuxi build`](https://nuxt.com/docs/api/commands/build) does not prerender HTML files by default, you need to use [`nuxi generate`](https://nuxt.com/docs/api/commands/generate) to generate the HTML files.\n\n```bash\nnpx nuxi generate\n```\n\nThe HTML file output path depends on your ([`nitro.output.publicDir`](https://nitro.unjs.io/config#output)) Nuxt configuration. By default, it will be placed in the `.output/public` directory.\n\n## Configuration\n\nYou can define these options in your `nuxt.config.js` file under the `singleHtml` key.\n\n#### Example Configuration:\n\n```javascript\nexport default {\n  modules: [\n    'nuxt-single-html'\n  ],\n  singleHtml: {\n    enabled: true,\n    deleteInlinedFiles: true,\n    output: '[name].html'\n  }\n}\n```\n\n#### Options:\n\n- **`enabled`** (boolean)  \n  - **Description:** Enables or disables the single HTML mode when running the `nuxt generate` command.\n  - **Default:** `true`\n\n- **`deleteInlinedFiles`** (boolean)  \n  - **Description:** Specifies whether to delete inlined files after generating the single HTML file.\n  - **Default:** `true`\n\n- **`output`** (string)  \n  - **Description:** The output filename for the generated single HTML file. You can use `[name]` to refer to the original HTML file name. \n  - **Default:** `'[name].html'`\n\n## FAQ\n\n### How are the assets built?\n\nAll assets (images, fonts, CSS, etc.) inside the [`assets/`](https://nuxt.com/docs/guide/directory-structure/assets) directory will be inlined into the single HTML file. However, assets inside the [`public/`](https://nuxt.com/docs/guide/directory-structure/public) directory will not be inlined. For more details, please refer to the [Nuxt Assets](https://nuxt.com/docs/getting-started/assets) documentation.\n\n### Why are multiple HTML files generated?\n\nIf you’re using Nuxt Pages, multiple single HTML files may be generated for each route. Each HTML file contains the full source code for all route pages, meaning they can operate independently and still support SPA behavior. The only difference is that each HTML file is pre-rendered for its corresponding route.\n\nSimply put, if you only need `index.html` as your entry point, you can deploy just the `index.html` and able to safely ignore the other HTML files. You can also check out config [memory history mode](https://nuxt.com/docs/guide/recipes/custom-routing#custom-history-advanced) to fit your needs.\n\n## Contribution\n\n\u003cdetails\u003e\n  \u003csummary\u003eLocal development\u003c/summary\u003e\n  \n  ```bash\n  # Install dependencies\n  pnpm install\n  \n  # Generate type stubs\n  pnpm dev:prepare\n  \n  # Develop with the playground\n  pnpm play\n  \n  # Build and preview the playground with single-html module\n  pnpm play:generate\n  pnpm play:preview\n  \n  # Run ESLint\n  pnpm lint\n  pnpm lint:fix\n  \n  # Release new version\n  pnpm release\n  ```\n\n\u003c/details\u003e\n\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/nuxt-single-html/latest.svg?style=flat\u0026colorA=020420\u0026colorB=00DC82\n[npm-version-href]: https://npmjs.com/package/nuxt-single-html\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-single-html.svg?style=flat\u0026colorA=020420\u0026colorB=00DC82\n[npm-downloads-href]: https://npmjs.com/package/nuxt-single-html\n\n[license-src]: https://img.shields.io/npm/l/nuxt-single-html.svg?style=flat\u0026colorA=020420\u0026colorB=00DC82\n[license-href]: https://npmjs.com/package/nuxt-single-html\n\n[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js\n[nuxt-href]: https://nuxt.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkodev%2Fnuxt-single-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserkodev%2Fnuxt-single-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkodev%2Fnuxt-single-html/lists"}