nrwl/nx

angular and nestjs shared library esbuild vs nestjs build settings

robc123 opened this issue · 0 comments

Documentation issue

  • Reporting a typo
  • Reporting a documentation bug
  • Documentation improvement
  • Documentation feedback

Is there a specific documentation page you are reporting?

Enter the URL or documentation section here.

Additional context or description

Provide any additional details here as needed.

Before switch to esbuild, both angular and nestjs serve and build ok.
After switch angular project.json to esbuild then nestjs reports error
Cannot access EntityClassBO before initialization.
This BO is defined with nestJS class-transformer decorators e.g. @expose() and @type
Similarly DTO classes use class-validator decorators e.g. @isboolean()

Research on NestJs issues shows that esbuild cannot handle decorators and using tsconfig settings to suit this is not supported. NestJs issues have no idea of NX context of api app.

Ideally NX Documentation would show how to setup the nestjs api project.json so that it will independently build the shared library to revert to the same output as the previous method, this output location for api serve during debug would need to be independent of the output location for angular serve during debug done by esbuild(vite?).
API build would need to do the same, build the shared lib with webpack (I'm not 100% sure if that is how the lib was built by the old angular serve/ build executor setting: @angular-devkit/build-angular:browser)

Thanks
Rob