<amd-dependency />

/// <amd-dependency />

Note: this directive has been deprecated. Use import "moduleName"; statements instead.

/// <amd-dependency path="x" /> informs the compiler about a non-TS module dependency that needs to be injected in the resulting module’s require call.

The amd-dependency directive can also have an optional name property; this allows passing an optional name for an amd-dependency:

1
2
3
/// <amd-dependency path="legacy/moduleA" name="moduleA"/>
declare var moduleA:MyType
moduleA.callStuff()

Generated JS code:

1
2
3
define(["require", "exports", "legacy/moduleA"], function (require, exports, moduleA) {
  moduleA.callStuff()
});
doc_TypeScript
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.