I have a monorepo setup with turborepo that includes a commons
library with shared code, a react web app and and NestJS app.
My NestJS app use some code from the library and I added paths in the tsconfig.json
like this
"paths": {
"@commons/*": [
"../../packages/commons/src/*"
]
}
If I run nest start
I have the following error:
Cannot find module '/home/username/dev/my-project/apps/backend/dist/main'
The dist
folder contains 1 folder for the app and 1 for the commons library:
apps/backend/src
and packages/commons/src
I’ve found a way to make the NestJS app work by changing the entry file to apps/backend/src/main
but it seems more like a workaround than the correct solution to me.
What I would like is to have my NestJS app built in direclty in the dist
folder.
Is there a config setup that would work this way ?
I have also check the NestJS “monorepo mode” doc but from what I understood, it seems like only NestJS apps monorepo and I guess, is not applying to other monorepo solutions.