In an attempt to separate the .ts source files from the .js output, I am trying to implement a formal file observer in TypeScript, and it seems that the ability to specify the output path for a single file does not exist.
Stream, just to be clear: I start looking at my entire src directory, making changes, say, src/views/HomeView.ts , and I want node to pick up the file that was changed, and move the compiled version to public/js/views/HomeView.js .
Using tsc myfile.ts --out myfile.js , it moves through all the modules and compiles each in the same path as the .ts file, without putting the final file in the correct path. However, it creates an empty file in which I would like it to end.
I am wondering:
1) Is it possible to use the --out and compile only one file? I do not want it to import and compile every single file, but just do syntax / error checking at compile time (and this is just a secondary requirement, not necessary); and
2) Is there a bug in the compiler that prevents it from combining / creating files correctly? Again, the end result in the path --out directive is empty, but the file is actually created.
Any help would be greatly appreciated.
* Update *
Although I do not want to close this question, since I believe this is still a problem, I went ahead and implemented the TypeScript core compiler to achieve what I needed to do, bypassing tsc in general. See https://github.com/damassi/TypeScript-Watcher for more information and usage.
cnp
source share