{"id":15478366,"url":"https://github.com/theengineerhub/staticit","last_synced_at":"2025-04-22T14:46:32.932Z","repository":{"id":57689425,"uuid":"481702186","full_name":"TheEngineerhub/staticit","owner":"TheEngineerhub","description":"Minimal, zero-configuration and fast solution for static site generation in any front-end framework.","archived":false,"fork":false,"pushed_at":"2024-10-01T23:21:12.000Z","size":753,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T14:13:07.155Z","etag":null,"topics":["pre-render","prerender","puppeteer","react","react-prerender","react-ssg","rollup","sifrr","ssg","static-site-generation","uwebsockets","vite","vue","vue-prerender","vue-ssg","webpack"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/staticit","language":"TypeScript","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/TheEngineerhub.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"open_collective":"engineerhub"}},"created_at":"2022-04-14T18:03:04.000Z","updated_at":"2024-11-07T15:12:29.000Z","dependencies_parsed_at":"2024-11-14T18:49:45.049Z","dependency_job_id":null,"html_url":"https://github.com/TheEngineerhub/staticit","commit_stats":{"total_commits":57,"total_committers":1,"mean_commits":57.0,"dds":0.0,"last_synced_commit":"e25c6ed5cb4aec49386865c214c1b1633c4d4a6e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEngineerhub%2Fstaticit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEngineerhub%2Fstaticit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEngineerhub%2Fstaticit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheEngineerhub%2Fstaticit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheEngineerhub","download_url":"https://codeload.github.com/TheEngineerhub/staticit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250262553,"owners_count":21401703,"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":["pre-render","prerender","puppeteer","react","react-prerender","react-ssg","rollup","sifrr","ssg","static-site-generation","uwebsockets","vite","vue","vue-prerender","vue-ssg","webpack"],"created_at":"2024-10-02T04:03:44.226Z","updated_at":"2025-04-22T14:46:32.911Z","avatar_url":"https://github.com/TheEngineerhub.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://storage.googleapis.com/engineerhub-static/staticit-transparent.png\" alt=\"Static-it\" height=\"250\" width=\"auto\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/TheEngineerhub/staticit/actions/workflows/build.yml\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/TheEngineerhub/staticit/actions/workflows/build.yml/badge.svg?branch=main\" alt=\"Build Status\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TheEngineerhub/staticit/issues\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/TheEngineerhub/staticit\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TheEngineerhub/staticit/blob/main/LICENSE.md\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/TheEngineerhub/staticit\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n#\n\n### Staticit - Introduction\n\nWhether you want to increase performance of your web application or improve SEO. Generally you have 2 options, use **SSR** (Server Side Rendering) or **SSG** (Static Site Generation). SSR can be cumbersome and you will need a server to host it.\n\nSSG is relatively simple and a good alternative. Some frameworks have this feature out of the box some don't, some are bloated and you may want a simpler solution. **Here comes the Staticit!**\n\nStaticit is a improved version of a small library called [react-spa-prerender](https://github.com/sPavl0v/react-spa-prenderer). Under the hood it uses [express](https://expressjs.com/) and [puppeteer](https://github.com/puppeteer/puppeteer) to generate static files.\n\nSince it's standalone it will work with any build tool and any front-end framework that supports routing.\n\n\u003e How it works?\n\n- Serves the web application from build directory with **express**.\n- Renders \u0026 generates desired routes with **puppeteer**.\n- Reformats all generated HTML files with **prettier** so they'll be pretty 🥰.\n\n#\n\n### Install\n\n\u003e \u003cimg src=\"https://storage.googleapis.com/engineerhub-static/exclamation-yellow.png\" height=\"15\" width=\"auto\" /\u003e - Latest **LTS Node.js** is recommended.\n\n- With npm:\n\n```sh\n$ npm install -D staticit\n```\n\n- With yarn:\n\n```sh\n$ yarn add --dev staticit\n```\n\n- With pnpm:\n\n```sh\n$ pnpm install -D staticit\n```\n\n#\n\n### Usage\n\nCreate a file called [`.staticit.json`](.staticit.json) in your project root directory. For minimal configuration add the following lines.\n\n```json\n{\n  \"routes\": [\"/\", \"/about\"],\n  \"outDir\": \"./dist\",\n  \"port\": 8080\n}\n```\n\n\u003e \u003cimg src=\"https://storage.googleapis.com/engineerhub-static/exclamation-yellow.png\" height=\"15\" width=\"auto\" /\u003e - If you are going to build your application in an automated environment, for example with a CI tool. You should pass the `--no-sandbox` flag to `puppeteer: launchOpts` or you might get errors since most of them are running inside of a container with root user. [(Ref)](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox)\n\n- Then add a postbuild step to your [`package.json`](package.json).\n\n```json\n\"scripts\": {\n  ...\n  \"postbuild\": \"staticit\"\n}\n```\n\n#\n\n### References\n\n\u003e JSON Reference\n\n| Option                 | Default  | Description                                                                         |\n| ---------------------- | -------- | ----------------------------------------------------------------------------------- |\n| routes                 | `[]`     | Array of routes that you want to pre-render \u0026 generate static files.                |\n| outDir                 | `./dist` | Relative path to the build directory of your application.                           |\n| port                   | `8080`   | The port where the static server will serve your web application for the puppeteer. |\n| puppeteer: launchOpts  | `{}`     | Generic launch options that can be passed when launching puppeteer browser.         |\n| puppeteer: waitForOpts | `{}`     | Timeout options for puppeteer browser.                                              |\n\n--\n\n\u003e CLI Reference\n\n| Option             | Description                                   |\n| ------------------ | --------------------------------------------- |\n| --disable-prettier | Disables formatting HTML files with prettier. |\n| -c, --config       | To use with different config file name.       |\n\n#\n\n### Examples\n\n- [React Example](https://github.com/TheEngineerhub/staticit/tree/main/examples/react)\n- Vue Example \u003ckbd\u003eComing soon.\u003c/kbd\u003e\n\n#\n\n### License\n\nThis repository is licensed under the [MIT](LICENSE.md) License.\n","funding_links":["https://opencollective.com/engineerhub"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheengineerhub%2Fstaticit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheengineerhub%2Fstaticit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheengineerhub%2Fstaticit/lists"}