3

My github project has an internal library dependency in its project/my-library subdirectory and Angular needs it compiled separately: ng build my-library before ng build

However, when I point Stackblitz at my github project, it says it can't find my-library. I suppose I could publish my-library to npm and it would work, but I'm still developing it.

Is there a way to get Stackblitz to compile my-library first and then the whole project?

jtalics
  • 83
  • 2
  • 6
  • Have you tried overriding the `start` npm script? Making it `start: "ng build my-library && ng serve"`? I'm not sure what stackblitz uses (I can't find anything related to this in the docs), but that would be a good place to start. – igg Mar 02 '20 at 16:58
  • 1
    Thank you so much for replying! You sent me in a great direction and I learned about the scripts section in package.json. Awesome tip and it has to work! But during experimentation, I've noticed that Stackblitz does not copy my github package.json, but rather provides it own. Weird, any ideas? If I figure it out I will comment here to pay it forward. Thanks for the awesome tip. --Ng newb – jtalics Mar 04 '20 at 14:17
  • I can't find any sources or docs mentioning exactly how stackblitz works in these situations. I tried changing the contents of `package.json` in a stackblitz environment, but it didn't seem to do anything. In a local environment, the scripts are a good way to solve your problem. – igg Mar 04 '20 at 18:11
  • I concur. Seems stackblitz is doing something undocumented. – jtalics Mar 05 '20 at 19:48

0 Answers0