microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.95k stars 602 forks source link

[heft] running heft test --watch and heft start at the same time results in infinite loop on webpack server #2587

Open scamden opened 3 years ago

scamden commented 3 years ago

Repro (in a project that has both jest and webpack dev configured):

  1. run heft test --watch
  2. run heft start

Expected both servers start and watch compiled output

Result webpack server starts looping infinitely

(Perhaps this is due to having two different heft build watches going, i think the ideal fix here would be to have an option for heft start to also run a test watch so there is only one ts build going)

iclanton commented 3 years ago

You're running these in two different console windows in the same CWD, right?

Webpack probably keeps on detecting writes to the lib folder. The simplest solution would be to include a start+test mode that both runs the Webpack server and the test watcher. That shouldn't be too hard. Maybe a test --serve command? Thoughts?

scamden commented 3 years ago

ya i think that's exactly right. i was thinking start --tests, but actually i think the ideal is start --no-tests and have tests run with server by default. (at least that's the workflow i've always used). aside from being how i like to develop. there's the benefit of having a universal start command that let's us run test watch for node library packages and test watch and server for node and web endpoints. that makes all heft commands meaningful for all packages and simply picks up whatver server-y sorts of things they have configured (basically jest and webpack but structurally could be an express server or other)