Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tsc compile AMD module with specified module id

Tags:

typescript

amd

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

like image 267
codetale Avatar asked Sep 28 '22 08:09

codetale


1 Answers

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.

like image 120
basarat Avatar answered Oct 06 '22 01:10

basarat