tsc编译具有指定模块ID的AMD模块 [英] tsc compile AMD module with specified module id

查看:195
本文介绍了tsc编译具有指定模块ID的AMD模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以配置Typescript编译器以使用定义的模块ID编译导出的类?

is it possible to config typescript compiler to compile exported class with define module id?

打字稿

export class Foo {...}

这是tsc输出(模块:"amd")

this is what tsc output (module: "amd")

define(["require", "exports"], function (require, exports) {...}

预期

define("Foo", ["require", "exports"], function (require, exports) {...}

非常感谢您

推荐答案

预期define("Foo")

使用超级秘密/// <amd-module name="Foo"/>

但是我建议不要这样做,因为这会使您的代码不必要地特定于AMD.

But I would advise against this as it will make your code needlessly amd specific.

这篇关于tsc编译具有指定模块ID的AMD模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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