Create a file structure like:
// File structure (every file is class or interface export)
Deferred/Deferred.ts
Deferred/Promise.ts
Deferred/index.ts
WebApp/ClassOne.ts
WebApp/ClassTwo.ts
WebApp/index.ts
Where each index.ts imports and re-exports all the stuff from that folder. e.g. Deferred/index.ts
:
import deferred_file = require('./Deferred');
export var deferred = deferred_file;
import promise_file = require('./Promise');
export var promise = promise_file;
Then compile this index.ts
with amd
flag and minify using r.js : http://requirejs.org/docs/optimization.html
PS: there is work being done in grunt-ts to create these index.ts
files for you : https://github.com/grunt-ts/grunt-ts/pull/69 which you can work on if you want.