It seems like in a Nrwl/Nx workspace there is only a single package.json file. Now if we have multiple applications, each dependent on different packages, then we have to include all of those package in the single package.json file and wouldn't that increase the size of all the apps when they're built? (presumable vendor.js file).
For example if app-1 depends on d3 and app-2 depends on ag-grid libraries, wouldn't both of these libraries be included for both app-1 and app-2 unnecessarily? When the user of app-1 visits the app, ag-grid wouldn't need to be loaded for them.
Am I correct in my understanding or am I missing something? If my assumption is correct, is there a way to solve this?
How about lazy loaded libraries? For instance an "admin" library which is only available to some users (with admin role) may need certain graphing packages, which wouldn't have to be loaded for all the users.
Thank you.