简体   繁体   中英

Move Typescript Project to VSCode

I started out my project using the Typescript HTML Application Template project template. It worked pretty well and created a project for me. However, I wish to migrate to using VSCode, but the problem I'm having is finding out which switches and compiler options the project uses for the "tsc" command. I see it referenced in the .csproj, but I don't know exactly how it's interacting with it. It doesn't seem to have created a tsconfig or anything, so how does the typescript compiler know what to do?

TL;DR, where does Visual Studio keep the typescript compiler options.

Thanks!

If you right-click on the project and select "Properties" there is a TypeScript compile tab on the bottom left. This is a friendly view over the configuration in the project XML.

You can extract these into a .tsconfig within Visual Studio. Once a .tsconfig is detected, the project settings no longer apply.

Once you have a working .tsconfig set up, you should be able to move easily to VS Code.

In Visual Studio 2015 some projects don't have a project XML file, in which case you can almost bet your config is equivalent to:

tsc app.ts --target ES5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM