简体   繁体   English

如何将 Angular 应用程序从 MonoRepo 转换为 PolyRepo?

[英]How to convert Angular Application from MonoRepo to PolyRepo?

I have created three angular applications separately that have an individual workspace or individual projects and individual repositories.我已经分别创建了三个 angular 应用程序,它们具有单独的工作区或单独的项目和单独的存储库。

I can share the modules among them by using the @angular-architects/module-federation.我可以使用@angular-architects/module-federation 在它们之间共享模块。 But I am unable to share the components and services.但我无法共享组件和服务。

How can I share the services and components among different workspaces or projects?如何在不同的工作空间或项目之间共享服务和组件?

Or或者

How can I implement Poly Repo based Angular Application?如何实现基于 Poly Repo 的 Angular 应用程序?

Thank You.谢谢你。

App2应用程序2

App1应用程序1

Use nx workspace, Which will allow you manage multiple repositories.使用nx工作区,这将允许您管理多个存储库。 There is a folder called 'libs'in workspace which we can add common module from there we can share components and services to all other repositories.工作空间中有一个名为“libs”的文件夹,我们可以从那里添加通用模块,我们可以将组件和服务共享到所有其他存储库。 Read nx documentation for more information.阅读 nx 文档以获取更多信息。 https://nx.dev/getting-started/nx-and-angular https://nx.dev/getting-started/nx-and-angular

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM