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 pile my Typescript.
Thanks!
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 pile my Typescript.
Thanks!
Share Improve this question asked Jun 25, 2013 at 16:13 nobodynobody 8,30313 gold badges62 silver badges96 bronze badges2 Answers
Reset to default 7This isn't directly supported. If you're interested in structuring your files this way, I'd remend 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