{"id":23906797,"url":"https://github.com/g770728y/angular-multi-project-demo","last_synced_at":"2026-06-17T22:31:02.869Z","repository":{"id":38741420,"uuid":"193882096","full_name":"g770728y/angular-multi-project-demo","owner":"g770728y","description":"一个完整angular程序切分为多个子项目的尝试","archived":false,"fork":false,"pushed_at":"2023-01-05T03:12:31.000Z","size":2618,"stargazers_count":0,"open_issues_count":25,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T14:15:51.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/g770728y.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":"2019-06-26T10:22:16.000Z","updated_at":"2019-06-26T10:28:25.000Z","dependencies_parsed_at":"2022-09-13T03:34:41.995Z","dependency_job_id":null,"html_url":"https://github.com/g770728y/angular-multi-project-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/g770728y/angular-multi-project-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g770728y%2Fangular-multi-project-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g770728y%2Fangular-multi-project-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g770728y%2Fangular-multi-project-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g770728y%2Fangular-multi-project-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g770728y","download_url":"https://codeload.github.com/g770728y/angular-multi-project-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g770728y%2Fangular-multi-project-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34468766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":[],"created_at":"2025-01-05T02:14:35.479Z","updated_at":"2026-06-17T22:31:02.853Z","avatar_url":"https://github.com/g770728y.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular 多个 project 组合成一个大项目\n\n## 为什么\n\n一个后台管理系统, 往往功能繁多, 开发时不容易实现隔离, 代码到处飞, 后期维护不便\\\n由于功能较多, 所以开发到中期, 会发现页面刷新越来越慢, 严重影响开发效率\\\n\n## 实现\n\n将每个菜单页作为一个 project 单独开发, 实现功能高度隔离\\\n每个 project 可单独运行, 大幅减少开发调试时间, 基本可以实现保存后立即出效果\\\n同时, 可以将整个 angular 项目作为整体打包\n\n当前实现: 使用 angular 自带的 project 功能\\\n\n\u003e https://medium.com/disney-streaming/combining-multiple-angular-applications-into-a-single-one-e87d530d6527\n\n## 与 lerna 比较\n\n可使用 lerna + ng-packagr 实现类似功能, 但非常麻烦, 举例:\\\n\n1. 很多 import \"./node_modules/...\"的地方, 需要修改路径\\\n2. 有时会报莫名其妙的错误, 虽然最终能够解决, 但心里感觉不安稳\n\n## 当前问题\n\n[ ] 未实现异步加载!\n原因 1: BrowserModule 在 app1/app2 中都用到, 重复了. 但如果改成 CommonModule, 则子项目无法单独运行, 很纠结\\\n解决: 可以保持 AppModule, 其包含 BrowserModule, 以便子项目可单独运行\\\n同时, 导出 AppInnerModule, 不包含 BrowserModule\n\n原因 2: 去掉主项目中所有对子项目的引用后, 打包时确实会打出 chunk 包, 但运行时会报有关 forRoot 的错\\\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg770728y%2Fangular-multi-project-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg770728y%2Fangular-multi-project-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg770728y%2Fangular-multi-project-demo/lists"}