My problem is that whenever I run nx build api I get a single main.js which includes everything in my monorepo. What I want is my libraries having their own .js bundles. It can be clearly seen here angular-spotify . If you compile the project, you will see that each library has own bundle file. Here is what it looks like: example dist folder.
I also made an example repo showing my problem here: example repo. As you can see, all I have is main.js file, despite having also shared module, which is supposed to have its own bundle file.
My goal ultimately is being able to use typeorm migration feature with typescript. My typeorm entities are TS files which located in a separate lib, but migration works only with JS entities. Thus I need to compile my TS entities (which include imports from other libs) to JS files and specify folder in the dist in ormconfig.json like this dist/entities/*.js. But it is not possible if I only have bare main.js as output file.