I want to know if it is possible to reference an entire directory in a typescript file rather than just doing one file at a time.
What I want is something like this:
/// <reference path="/path/to/folder" />
but what I end up having is
/// <reference path="/path/to/folder/file1" />
/// <reference path="/path/to/folder/file2" />
/// <reference path="/path/to/folder/file3" />
Does anyone know how to do this correctly? Visual Studio tells me the file doesn't exist when I just try to put in the directory path and it doesn't compile my Typescript.
Thanks!
This isn't directly supported. If you're interested in structuring your files this way, I'd recommend having an intermediate file to reference which in turn references all the other files; it'd be pretty easy to write a script to update that file.
It turns out there is an easy way since TS 1.5:
Use the filesGlob
-flag in the tsconfig.json :
This allows wildcards like /path/to/folder/*
You can read more here: http://blog.icanmakethiswork.io/2015/02/hey-tsconfigjson-where-have-you-been.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With