Visual Studio TypeScript 选项 [英] Visual Studio TypeScript Options

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

问题描述

如何告诉 TypeScript 编译器从 Visual Studio 中生成 amd 模块 (--module amd).

How do I tell the TypeScript compiler to generate amd modules (--module amd) from within Visual Studio.

谢谢.

推荐答案

在您的项目文件中,您需要更改正在构建 TypeScript 文件的 MSBuild 目标.如果您使用使用 TypeScript 构建的 HTML 应用程序"的默认模板,请卸载您的项目,编辑项目文件,您将在$(PROGRAMFILES)\Microsoft SDKs\TypeScript"中找到一个名为BeforeBuild"的目标正在调用编译器\0.8.0.0\tsc", 添加 --module amd ;保存并重新加载您的项目.下次构建时,您应该会看到命令参数正确传递给编译器.

In your project file you will need to change the MSBuild target that is building TypeScript files. If you are using the default template for "HTML Application built with TypeScript", unload your project, edit the project file, you will find a target called "BeforeBuild" that is calling the compiler at "$(PROGRAMFILES)\Microsoft SDKs\TypeScript\0.8.0.0\tsc", add --module amd to it; save and reload your project. next time you build you should see the command argument passed correctly to the compiler.

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

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