Reputation: 231
I want to build a nestjs backend which is used by a angular frontend application. Each of them for now in a single repository. I stumbled over nrwl-nx for monorepo tooling and am really intrigued to use it.
But my question now is: is it possible to have different apps in the workspace, but each as an own git submodule? Like so:
workspace_folder
|- apps
| |- application1 <--- git submodule 1
| |- application2 <--- git submodule 2
|- libs
|...
How would the process be to set them up correctly? Can it be done completely by the nx CLI? I couldn't find anything specific to that in the nx documentation.
Upvotes: 17
Views: 5247
Reputation: 2021
Yes! I believe you can do this using Yarn workspace in conjunction with Nx tooling.
So in essence you need to navigate to your apps folder and run:
git submodule add https://github.com/[URL for your application 1] application1
git submodule add https://github.com/[URL for your application 2] application2
More Details here: https://blog.nrwl.io/dev-workflow-using-git-submodules-and-yarn-workspaces-14fd06c07964
An example will be like this: https://github.com/nrwl/nx-example-multirepo
Upvotes: 5