{"id":13725441,"url":"https://github.com/developit/nextjs-preact-demo","last_synced_at":"2025-04-06T20:12:18.521Z","repository":{"id":56532047,"uuid":"237808722","full_name":"developit/nextjs-preact-demo","owner":"developit","description":"Next.js 9.3 + Preact = 21kB","archived":false,"fork":false,"pushed_at":"2020-11-02T07:55:38.000Z","size":735,"stargazers_count":384,"open_issues_count":4,"forks_count":24,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T18:11:15.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nextjs-preact.now.sh","language":"JavaScript","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/developit.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}},"created_at":"2020-02-02T17:32:10.000Z","updated_at":"2024-12-31T16:29:08.000Z","dependencies_parsed_at":"2022-08-15T20:30:54.253Z","dependency_job_id":null,"html_url":"https://github.com/developit/nextjs-preact-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fnextjs-preact-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fnextjs-preact-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fnextjs-preact-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fnextjs-preact-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developit","download_url":"https://codeload.github.com/developit/nextjs-preact-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543593,"owners_count":20955865,"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":[],"created_at":"2024-08-03T01:02:23.360Z","updated_at":"2025-04-06T20:12:18.496Z","avatar_url":"https://github.com/developit.png","language":"JavaScript","readme":"# Preact example\n\nThis is a fully working example of Next.js 9.5 running on [Preact](https://github.com/preactjs/preact) instead of React.\n\nThis reduces the base JavaScript weight of pages to ~22kB.\n\n\u003e 🔭 In the future, this can be even smaller with some additional Webpack optimizations.\n\n## How to use\n\nClone this repo and run `npm install`:\n\n```sh\ngit clone https://github.com/developit/nextjs-preact-demo.git\ncd nextjs-preact-demo\nnpm install\n```\n\nThere are three commands available:\n\n```sh\n# start a development server:\nnpm run dev\n\n# create a production build:\nnpm run build\n\n# start a production server:\nnpm start\n```\n\n## How does it work?\n\nThe example takes advantage of npm/yarn aliases, which essentially allow installing `preact/compat` at `node_modules/react`.\n\nHere's how this example repo was set up:\n\n- Set up a basic Next.js app using `create-next-app`\n- Install `preact`, uninstall `react` and `react-dom`.\n- Install [preact-compat/react](https://github.com/preact-compat/react) and [preact-compat/react-dom](https://github.com/preact-compat/react-dom) for aliasing.\n- Use an [npm alias](https://github.com/npm/rfcs/blob/latest/implemented/0001-package-aliases.md#detailed-explanation) to replace `react-ssr-prepass` with `preact-ssr-prepass` (also [works](https://twitter.com/sebmck/status/873958247304232961) with Yarn).\n","funding_links":[],"categories":["JavaScript","Nextjs Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fnextjs-preact-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopit%2Fnextjs-preact-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fnextjs-preact-demo/lists"}