Nx monorepos in deployment ? #6352
Replies: 1 comment 4 replies
-
I have a similar problem that has been bothering me for a long time. The files needed for the deployment of the backend can now be generated as follows:
or
The created files from the dist directory of the backend app are now copied to the embedded device, on which node is installed. Often it is recommended to copy the file package.json of the nx workspace as well and then just run However, this file contains the dependencies of all apps from the nx workspace. The worst part is that you can't even track which application needs which dependencies anymore, because the package.json doesn't contain that information. What is actually needed is a way to generate a package.json file that only contains the (production) dependencies of the nestjs backend app. Actually I assumed that this is exactly the task of the nx framework and would be generated by the command Did I miss something or is this important feature not supported? Unfortunately, this would be an exclusion criterion for our project. |
Beta Was this translation helpful? Give feedback.
-
Hello, currently I adopt Nx monorepos to hold my 3 apps, it was fascinating how Nx can be a great solution for a modern development approach, to deal with multiple apps and libs. When it came to the deployment phase (AWS Amplify) the cost takes the seat of judgment, Since Nx designed to store all the workspace dependencies in one place to keep track of versioning and reusability, it made the deployment more expensive on build time due to the number of dependencies of all workspace that should be installed before one app get to build.
Can anybody suggest me the best approach to get the most of Nx features with less cost in terms of bundle size and build time on deployment?
Beta Was this translation helpful? Give feedback.
All reactions