TypeScript/Visual Studio 2012/编译参数 [英] TypeScript / Visual Studio 2012 / Compilation parameters
问题描述
当从Visual Studio 2012执行TypeScript编译器时,我需要生成源映射.在Sublime Text 2中,我只需要向构建脚本添加一个额外的参数. 我在VS 2012中迷路了. Build部分似乎没有可向构建过程添加构建参数的部分.
I need to generate Source Maps when the TypeScript Compiler is executed from Visual Studio 2012. In Sublime Text 2, I just had to add an extra parameter to the build script. I'm lost in VS 2012. The Build section doesn't seem to have a section to add build parameters to the build process.
命令开关是"-sourcemap".
The command switch is "-sourcemap".
例如:tsc -sourcemap file.ts
As such: tsc -sourcemap file.ts
推荐答案
目前尚无用于编辑TypeScript构建标记的VS 2012 UI,但是您可以通过编辑项目文件并添加-sourcemap
标记为该构建步骤.
There isn't a VS 2012 UI for editing the TypeScript build flags (yet) but you can get what you want by editing the project file and adding the -sourcemap
flag to that build step.
<Target Name="BeforeBuild">
<Exec Command=""$(PROGRAMFILES)\Microsoft SDKs\TypeScript\0.8.0.0\tsc" -sourcemap @(TypeScriptCompile ->'"%(fullpath)"', ' ')" />
</Target>
这篇关于TypeScript/Visual Studio 2012/编译参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!