HungDL
HungDL

Reputation: 513

visual-studio-2015 Typescript compiler does not compile d.ts files from external libarry

I'm using react-global, flux from tsd. After installation, only files d.ts files were downloaded. My visual studio does not compile those of libraries to output js file. That is the reason for failures when executing in client.

how can I include d.ts files to generated js file?

Thanks,

Upvotes: 1

Views: 182

Answers (2)

masonk
masonk

Reputation: 9788

toskv is right, but I'll just elaborate.

tsd is the TypeScript definition manager for node. All it does is manage the TypeScript declarations files for popular JavaScript projects. (Native TypeScript projects are self-declaring and don't need any definitions files).

React and flux are JavaScript projects. You need to install them (using npm if you are on node), and then you need to arrange for them to be loaded at runtime (e.g., using require.js). If you package and deploy the app to a remote server you'll also need to arrange for them to be packaged, using Browserify or one of its many competitors.

Upvotes: 1

toskv
toskv

Reputation: 31600

.d.ts files are there only to provide you with a description of the external library while developing. They do not get compiled to anything.

You still have to include the thirdparty javascript files in your project.

Upvotes: 0

Related Questions