I just put together a blog on how to use AMD modules in TypeScript .
First, just use the link path to the trunk as follows:
Then define your class without import:
export class MTodoCollectionView extends Backbone.View { ... }
Then your require.config and apploader:
require.config({ baseUrl: '../', paths: { 'underscore': 'lib/underscore', 'backbone': 'lib/backbone' }, shim: { underscore: { exports: '_' }, backbone: { deps: ["underscore", "jquery"], exports: "Backbone" } } }); require(['jquery','underscore','backbone','console','app/AppMain', ], ($, _, Backbone, console, main) => { // code from window.onload var appMain = new main.AppMain(); appMain.run(); });
As soon as the application enters the required code block, the Backbone will be defined globally.
Good luck
source share