打字稿、AMD 和模块名称

Typescript, AMD and module names

有没有办法设置*.ts编译模块的名称? 一些 tsconfig,json 设置,或一些 Gulp 插件可以做到这一点。

目前我正在

define([], function(){ .. })

但我不想这样设置名称:

define('module-name', [], function(){ .. })

尝试了一些 gulp 插件,但它们覆盖了 sourcemaps 信息,我失去了浏览器中的 "ts debugging" 功能

您可以在模块顶部使用声明来获得所需的结果:

///<amd-module name='foo-module'/>

这将导致

define('foo-module', [], function(){ .. })

由编译器发出