Using TypeScript in an existing Visual Studio Web Site project

前端 未结 8 2216
南旧
南旧 2020-11-29 06:16

I\'ve got an existing Visual Studio project that was setup as a \"Web Site\" project. You can create projects like this by going to File->New Web Site. This is a different

8条回答
  •  我在风中等你
    2020-11-29 07:01

    As of version 0.8.2, released 21-Jan-2013, the VS2012 TypeScript plug-in supports compile-on-save without using WebEssentials. Go to Tools > Options > Text Editor > TypeScript > Project section and check the "Automatically compile..." box.

    If you want to compile all your .ts files into a single .js file as part of your build process (which you probably should), then make sure the app.ts script has s to all the files that should be included, and add the following pre-build step to your project:

    "C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe" --out app.js app.ts
    

    (Specifying the --out parameter tells tsc to include all referenced files.)

提交回复
热议问题