{"id":24003444,"url":"https://github.com/rich-group/mpa-react-webpack","last_synced_at":"2026-04-15T19:39:53.778Z","repository":{"id":207303086,"uuid":"718908112","full_name":"rich-group/mpa-react-webpack","owner":"rich-group","description":"webpack 构建的 react mpa 项目模版","archived":false,"fork":false,"pushed_at":"2023-11-15T03:12:37.000Z","size":173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-17T19:03:16.717Z","etag":null,"topics":["mpa","react","templates","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/rich-group.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}},"created_at":"2023-11-15T03:07:31.000Z","updated_at":"2023-11-16T05:48:16.000Z","dependencies_parsed_at":"2023-11-15T05:35:15.583Z","dependency_job_id":null,"html_url":"https://github.com/rich-group/mpa-react-webpack","commit_stats":null,"previous_names":["rich-group/mpa-react-webpack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rich-group/mpa-react-webpack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rich-group%2Fmpa-react-webpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rich-group%2Fmpa-react-webpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rich-group%2Fmpa-react-webpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rich-group%2Fmpa-react-webpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rich-group","download_url":"https://codeload.github.com/rich-group/mpa-react-webpack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rich-group%2Fmpa-react-webpack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31857616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","react","templates","webpack"],"created_at":"2025-01-08T01:38:34.990Z","updated_at":"2026-04-15T19:39:53.753Z","avatar_url":"https://github.com/rich-group.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### 初始化\n\n初始化工作区子包`js` 和 `ts`\n```sh\nnpm init -y -w ./examples/js\nnpm init -y -w ./examples/ts\n```\n\n初始化命令完成后，会自动创建 `examples` 文件夹，里面多了 `js` 和 `ts` 两个项目\n\n并且 package.json 文件中多了 `workspaces` 的配置\n\n```json\n{\n  \"workspaces\": [\n    \"examples/js\",\n    \"examples/ts\"\n  ]\n}\n```\n\n\n### 安装依赖\n\n全局安装子包依赖\n\n添加`abbrev` 作为 工作区 `js` 的依赖项。可以使用工作区配置`（-w）`告诉 npm 安装包应作为所提供工作区`（js）`的依赖项`（abbrev）`\n```sh\nnpm install abbrev -w js\n```\n\n执行完成后，发现依赖包 `abbrev` 安装到 `根目录` 的 `node_modules` 下，而依赖配置添加到了工作区 `js` 的 `package.json` 中。\n\n```txt\n├── examples\n│   ├── js\n│   ├── ts\n├── node_modules\n│   ├── abbrev\n```\n\n### 执行\n\n```sh\nnpm run test --workspace=js\n```\n\n同时执行多个工作区\n```sh\nnpm run test --workspace=js --workspace=ts\n# 或, 不过它们的执行顺序是按照在 package.json 中 workspaces 定义的顺序来的\nnpm run test --workspaces\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frich-group%2Fmpa-react-webpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frich-group%2Fmpa-react-webpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frich-group%2Fmpa-react-webpack/lists"}