Question

What is defining the exports module in the following snippet?

define(["require", "exports", 'durandal/app', 'durandal/http'], function(require, exports, __app__, __http__) {
.
.
.
}

I checked out this example, opened the solution and couldn't figure out whatever is defining the "exports" module. Is that just native to RequireJS now, or is there an external reference that I'm still missing?

Était-ce utile?

La solution

Ass soon as you import anything in typescript and compile with amd you get a define with require and exports.

exports is requireJS handle for anything you want to export from this module. e.g.

export var foo = 123; 

will generate

exports.foo = 123;

Which is utilized by requirejs import on the other end.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top