I have a Nrwl Nx repo with different apps (angular, nodejs with express) and shared libs inside.
The repo was created with the nx cli
and I want to build for production one of the express
apps.
nx build:production myexpressapp
The bundle I get is very nice and runs if I run it (with pm2) from where it was built (dist
folder).
However, if I get it to production, the node modules are missing and the app does not start.
If I copy the node_modules folder above the one with the built dist it works as well.
But I would very much like either of:
- Getting a big bundle with all the required modules inside of it?
- Getting another 'vendors' bundle along my main one where all the needed modules are?
I tried using "vendorChunk":true
in my production build options but nothing changes.
Any thoughts?