A simple demo Backbone app structured using RequireJS AMD format written in TypeScript.
Compile JS dependencies using:
tsc --module AMD app.ts
The important parts of note are:
-
Module dependency declaration to let TypeScript know that you have an external dependency.
/// <amd-dependency path="backbone" \>
/// <reference path="backbone.d.ts" \>
-
Refer to your 'imported' module with a
module = require('moduleName'))
statement which will be available in the define block so no need to worry about a load callback