{"id":15102072,"url":"https://github.com/shilangyu/cra-preact","last_synced_at":"2025-09-27T00:30:49.201Z","repository":{"id":47680001,"uuid":"244156231","full_name":"shilangyu/cra-preact","owner":"shilangyu","description":"Comfort of CRA + preact without ejecting 🔥","archived":true,"fork":false,"pushed_at":"2023-04-20T07:27:11.000Z","size":293,"stargazers_count":27,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-20T06:30:57.276Z","etag":null,"topics":["cra","cra-preact","crea-react-app","no-ejecting","preact","rewired","smaller-cra"],"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/shilangyu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-03-01T13:41:01.000Z","updated_at":"2023-04-20T07:28:07.000Z","dependencies_parsed_at":"2024-06-21T19:39:53.865Z","dependency_job_id":null,"html_url":"https://github.com/shilangyu/cra-preact","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":0.08695652173913049,"last_synced_commit":"24223cf9cfced6258ffcce0d0316330e1a2e5272"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilangyu%2Fcra-preact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilangyu%2Fcra-preact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilangyu%2Fcra-preact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shilangyu%2Fcra-preact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shilangyu","download_url":"https://codeload.github.com/shilangyu/cra-preact/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871827,"owners_count":16554457,"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":["cra","cra-preact","crea-react-app","no-ejecting","preact","rewired","smaller-cra"],"created_at":"2024-09-25T18:46:29.539Z","updated_at":"2025-09-27T00:30:48.861Z","avatar_url":"https://github.com/shilangyu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"⚠️ This project is [now archived](https://github.com/shilangyu/cra-preact/issues/5#issuecomment-1515847168). You should use [Vite](https://vitejs.dev/) with the Preact preset instead. ⚠️\r\n\r\n# [create react app](https://create-react-app.dev/) + [preact](https://preactjs.com/) = 💖\r\n\r\n[![](https://github.com/shilangyu/cra-preact/workflows/ci/badge.svg)](https://github.com/shilangyu/cra-preact/actions)\r\n\r\n### _Love the CRA bootstrap? Hate big bundle sizes?_\r\n\r\n```sh\r\nnpm i -D cra-preact\r\n# or\r\nyarn add --dev cra-preact\r\n```\r\n\r\nWrite your code as if you weren't using `preact`, continue importing `react`.\r\n\r\n## usage\r\n\r\nReplace your `build`, `start` and `test` scripts\r\n\r\n```diff\r\n\"scripts\": {\r\n- \"start\": \"react-scripts start\",\r\n- \"build\": \"react-scripts build\",\r\n- \"test\": \"react-scripts test\",\r\n+ \"start\": \"cra-preact start\",\r\n+ \"build\": \"cra-preact build\",\r\n+ \"test\": \"cra-preact test\",\r\n  \"eject\": \"react-scripts eject\"\r\n}\r\n```\r\n\r\nCool, done. Now watch the bundle size go down.\r\n\r\n## bundle size drop porn\r\n\r\n### initial CRA bootstrap\r\n\r\n![initial app](assets/initial.png)\r\n\r\n### medium size real-world production project\r\n\r\n![middle size](assets/medium-size.png)\r\n\r\n## disclaimer\r\n\r\nWhile rare, problems may occur.\r\n\r\n- Please be aware that `cra-preact` is using preact's compatibility layer (`preact/compat`) and issues with it should be directed to [preact's repo](https://github.com/preactjs/preact/issues)\r\n- Make sure to develop and test with `cra-preact` to catch incompatibilities during development\r\n- This project requires react-scripts v3+\r\n- It is **NOT** recommended to plug this into existing projects just as a build script. Incompatibilities will most likely surface during runtime, not compile time\r\n- Because it relies on fine details in `react-scripts` any minor upgrade of it might be a breaking change for `cra-preact`\r\n- While it works with npm, there are no tests available for npm. Because `npm link` and `npm install` don't respect peer dependencies\r\n\r\n---\r\n\r\nThis whole project was inspired by [this](https://github.com/facebook/create-react-app/issues/1230#issuecomment-334284088) github comment.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshilangyu%2Fcra-preact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshilangyu%2Fcra-preact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshilangyu%2Fcra-preact/lists"}