0

I have project where I have a both the frontend (Angular) and backend server code (NestJS).

In the folder I have separate folders for frontend and server and in both folders separate package.json and node_modules folders

If I go to the frontend folder which holds the Angular project and run "ng build" it clearly also tries to build the type script files which are in the server folder.

Why and how to define that it does not ? I have tried with different directory settings in angular.json and tsconfig.json (and tsconfig.app.json) but it seems it does not help.

This is the error I receive, this is because I have not run npm install in the server folder but I take it this is proof that it tries to compile those files as well.

Thanks, Jani

ERROR in ../../server/src/repository/file.storage.repository.ts:2:50 - error TS2307: Cannot find module 'dir-compare'

jani_r
  • 637
  • 1
  • 7
  • 18
  • would you mind sharing your `angular.json` file, as well as some of the folder structure you have in your app? – The Fabio Nov 10 '19 at 08:29
  • Here is the angular.json, https://pastebin.com/Fq5rYr5g and the folder structure, https://pastebin.com/PNNpYiwD – jani_r Nov 10 '19 at 10:04
  • That structure has worked fine so far and it compiles to the corresponding dist directories the correct things. Recently I started receiving strange errors and then I noticed that the "ng build" is for some reason also trying to compile the nestjs server side – jani_r Nov 10 '19 at 19:07
  • I was able to figure this out, it was my own mistake. I had for some reason referenced the server side class in an import on the client side. – jani_r Nov 12 '19 at 09:12

0 Answers0