tsc compile AMD module with specified module id

别等时光非礼了梦想. 提交于 2019-12-10 18:16:12

问题


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

typescript

export class Foo {...}

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

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

expected

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

Thank you very much


回答1:


expected define("Foo")

Use the super secret /// <amd-module name="Foo"/>

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



来源:https://stackoverflow.com/questions/31363604/tsc-compile-amd-module-with-specified-module-id

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!