Incremental compilation and tsc compiler

Topics: General
Jun 27, 2013 at 8:23 PM
Hi,

We have a large JavaScript project and are evaluating TypeScript. A lot of developers are on macs so we need to have the workflow be compatible with node.js. We've looked at grunt-typescript and using tsc directly but the problem is it seems to be compiling everything everytime a file is changed.

We can use grunt-contrib-watch to only recompile individual files but doing that doesn't seem to take dependencies into account.

Is there a good way to incrementally compile large TypeScript projects using node.js at the moment?

Thanks
Jan 18, 2014 at 5:04 PM
I'm also interested in this issue too. This could be also a solution to my other question: https://typescript.codeplex.com/discussions/507413
Jan 24, 2014 at 11:17 PM
I wrote something that works with grunt-typescript and grunt-contrib-watch to do incremental compilation:

https://github.com/bryanforbes/core/blob/0e423d5fa93a15e29c850029894ccee8c784f33e/Gruntfile.js#L134-L240

It scans files that are watched for import something = require('./path/to/something') as well as /// <reference path="./path/to/something/something" />. It only scans relative paths as I don't have a need right now. Hopefully this points you in the right direction.