{"id":16882366,"url":"https://github.com/wilsonpage/webpack-simple-ssr-react-mpa-example","last_synced_at":"2025-10-05T07:39:40.630Z","repository":{"id":144915035,"uuid":"108264973","full_name":"wilsonpage/webpack-simple-ssr-react-mpa-example","owner":"wilsonpage","description":"A minimal example of an app that renders React components on the server and 'inflates' (becomes interactive) on the client.","archived":false,"fork":false,"pushed_at":"2017-10-26T09:25:35.000Z","size":87,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T12:17:11.122Z","etag":null,"topics":["mpa","preact","react","ssr","webpack"],"latest_commit_sha":null,"homepage":"","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/wilsonpage.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":"2017-10-25T12:11:02.000Z","updated_at":"2022-06-18T12:50:11.000Z","dependencies_parsed_at":"2023-07-22T16:15:30.399Z","dependency_job_id":null,"html_url":"https://github.com/wilsonpage/webpack-simple-ssr-react-mpa-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wilsonpage/webpack-simple-ssr-react-mpa-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonpage%2Fwebpack-simple-ssr-react-mpa-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonpage%2Fwebpack-simple-ssr-react-mpa-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonpage%2Fwebpack-simple-ssr-react-mpa-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonpage%2Fwebpack-simple-ssr-react-mpa-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilsonpage","download_url":"https://codeload.github.com/wilsonpage/webpack-simple-ssr-react-mpa-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonpage%2Fwebpack-simple-ssr-react-mpa-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278425444,"owners_count":25984682,"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-10-05T02:00:06.059Z","response_time":54,"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":["mpa","preact","react","ssr","webpack"],"created_at":"2024-10-13T16:06:59.562Z","updated_at":"2025-10-05T07:39:40.600Z","avatar_url":"https://github.com/wilsonpage.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Webpack Simple Server-Side (SSR) Rendered React Multi-Page App (MPA) Example\n\n\u003e A minimal example of an app that renders React components on the server and 'inflates' (becomes interactive) on the client.\n\n#### Motivation\n\nThere are many examples of single page applications (SPA), but for many projects a SPA is overkill, leading to unnecessary work and complexity. We still want rich experiences, but don't care so much about client-side routing.\n\nThis project is by no means finished. I hope for others to contribute so that it can improve over time and become an example to others entering what has become a very complex development environment.\n\n#### setup\n\n```bash\n$ yarn\n$ yarn start\n```\n\n#### Requirements\n\n- [x] It must dynamically compile a bundle per page\n- [x] It must create a 'commons' chunk with shared dependencies (eg. `(p)react`)\n- [x] It must extract CSS into a separate `.css` per page file.\n- [x] Each bundle must be able to indicate critical CSS modules that should be inlined\n- [ ] Remove critical CSS from each page's CSS bundle\n- [x] Our server needs to be able to know the hashed filenames so they can be rendered/loaded into the document\n- [x] Page components can provide `\u003chead\u003e` content\n- [x] Each page component has a dedicated node bundle for SSR\n- [ ] Add a site-global app manifest using [webpack-app-manifest-loader](https://github.com/markdalgleish/web-app-manifest-loader)\n- [ ] Include example of dynamic (lazy) imported modules\n- [x] Support nested pages (eg. `articles/one`, `articles/two`)\n- [x] Dynamically setup server-side routes\n- [ ] Rebuild and restart server on file change\n- [x] Error pages\n- [ ] Decouple views from routes\n\n#### Webpack Dev server\n\n[Webpack-Dev-Server](https://github.com/webpack/webpack-dev-server) has been purposefully omitted to keep the development environment as close to production as possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonpage%2Fwebpack-simple-ssr-react-mpa-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilsonpage%2Fwebpack-simple-ssr-react-mpa-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonpage%2Fwebpack-simple-ssr-react-mpa-example/lists"}