So the other day while working (on my Mac) on a plugin I was using
tsc -w and after every second compilation tsc would exit with an out of memory error.
This can be fixed by enlarging node’s heap. The best way I could find was this global fix that changes the heap from the default (1.7 GB?) to 4GB:
Open this file:
Change its contents to:
#!/usr/bin/env node --max-old-space-size=4096 require('../lib/tsc.js')
tsc -w works forever and ever!