TypeScript/Visual Studio 2012/编译参数 [英] TypeScript / Visual Studio 2012 / Compilation parameters

查看:98
本文介绍了TypeScript/Visual Studio 2012/编译参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当从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="&quot;$(PROGRAMFILES)\Microsoft SDKs\TypeScript\0.8.0.0\tsc&quot; -sourcemap @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" />
</Target>

这篇关于TypeScript/Visual Studio 2012/编译参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆