In my project, I have a package.json
file, and use npm install
to install all dependencies
.
And now, I want auto install all typescript definition file base on package.json.
How can I do it.
Thanks.
How to install all typescript definition file based on packages.json?
4k views Asked by ThuyNguyen At
1
You can't do it directly, you need to include a
tsd.json
file which has the references to which typescript definition files you want to use. There are various commands to automatically get everything from your tsd file (including ways to do it via Grunt/Gulp if you want to automate everything).There might be an option to build up your
tsd.json
file though. See the documentation, Link to bundled definitions.Again, their documentation is fairly good with good examples everywhere. Check it out let let us know if something is missing or you have a specific problem trying to do something.
Edit - Typings
As mentioned by @JoeClay (see comments below) TSD has been depreciated, use Typings instead. There is a good section on there on converting from TSD to Typings if you have already embedded TSD in your app, otherwise I would recommend you skip TSD and use Typings from the get-go.
As to your original question it still looks like you need a
typings.json
file which contains references to your typescript (.d.ts
) dependencies.