joonhocho / tscpaths

Replace absolute paths to relative paths after typescript compilation
MIT License
266 stars 50 forks source link

Watch mode support #4

Open bobmoff opened 5 years ago

bobmoff commented 5 years ago

Does it work in watch mode?

tomspeak commented 5 years ago

@joonhocho -- would like to know this too, any thoughts?

adxmcollins commented 5 years ago

@bobmoff / @tomspeak - if you haven't got this working yet (and for anyone else in future)

Got watch mode working with a package called tsc-watch (see here).

Works like so: tsc-watch --onSuccess "tscpaths -p tsconfig.json -s ./src -o ./dist"

tsc-watch simply extends tsc and offers additional functionality such as onSuccess, onFailure, etc

tsc-watch's --onSuccess method is called on every successful compile, or you can alternatively use --onFirstSuccess to run on the first successful compile only