Admin.js + Nest.js monorepo (ESM and CJS)

130 views Asked by At

I want to create a mono repo with 3 folders:

  • adminjs
  • api
  • shared

Adminjs, created with adminjs create (v7 on nest.js). As written in their documents, it only supports ESM. The api is a simple nest application with mongoose. As I understand it, it only supports CJS. A shared folder is a folder that contains some nestjs/mongoose utilities and schemas with decorators.

Maybe someone has faced a similar problem. How to describe package.json and tsconfig to connect a shared folder to each application together. Maybe someone can describe an example please. Or maybe someone sees some available repositories to look at?

I am grateful to everyone who responds.

I have already tried to make shared folders for build/esm/... and build/cjs/... But it doesn't help and I have problems after building the main applications. Each time there are different import issues and I can't solve them.

0

There are 0 answers