Can I compile a single file?

Topics: General
Jul 1, 2014 at 11:17 PM
Edited Jul 2, 2014 at 9:59 PM
I'd like to implement a setup where I compile only files that are changed. I thought it would be a good feature, but apparently not.

Update: Added the clarification here:

Consider three amd files:

main.ts // requires somelib.ts
somelib.ts // requires someotherlib.ts
someotherlib.ts

I can't compile main.ts without compiling other files. I'd like to compile each file separately, and sync the JS file modified with TS file modified, if they are same then I don't need to transpile that file again.
Coordinator
Jul 2, 2014 at 5:10 PM
You can use Compile-on-save in Visual Studio; under the covers, CoS only builds what changed. alternatively on node you can use --watch.
Jul 2, 2014 at 6:40 PM
Uh, but I don't want to --watch, I'd like to build only changed files on demand. If you look at my issue the danquirk said I should do this on my own build step, but if I can't build a single file, how can I make my own buildstep to build only changed files in the first place?

I'm btw using Eclipse, I tried to install the latest VS Windows Express Update 2 and Web Express few days ago but TypeScript template was not there, I suppose it's not available for free version.
Jul 2, 2014 at 9:49 PM
Reason this is important is that if the project is huge, the recursive compilation is really wasteful. I opened a issue to compiling a single file.

I could simply transpile those typescript files that have differing modified time from JavaScript files. But this is not possible if I can't transpile a single file, it always seems to do recursion compilation.
Jul 4, 2014 at 10:15 AM
mhegazy wrote:
You can use Compile-on-save in Visual Studio; under the covers, CoS only builds what changed. alternatively on node you can use --watch.
I tried --watch, it also recurses to compiling all dependencies each time I change a single file. Is the Visual Studio only tool that can build only the files that have been changed?