This project has moved and is read-only. For the latest updates, please go here.

BundleTransformer.TypeScript CommonJS module support

Oct 30, 2013 at 2:29 PM
Edited Oct 30, 2013 at 6:02 PM
Hi, really like your BundleTransformer, but i am really puzzled as to why it doesn't support CommonJS modules (or AMD for that matter), isn't it just a matter of changing the moduleGenTarget option?

I experimented a little by setting defaultOptions.moduleGenTarget option to 1 in tscHelper.js, this resulted in correctly generated CommonJS modules. but in TransformerBase.ConfigureBundleResponse() the content of the asset was never used, only the virtual path.
Oct 31, 2013 at 10:22 AM
Hello, Caroen!

If problem was only with option moduleGenTarget, then support of CommonJS and AMD modules was'd have been implemented.

In addition to this have yet many things to implement:
  1. Resolve all dependencies;
  2. Implement module builder like the r.js library.
Now I have no time.

In general, CommonJS and AMD modules does not harmonious with the concept of bundles. At this moment, I recommend you to use implementations of TypeScript for MSBuild and NodeJS.
Oct 31, 2013 at 1:21 PM
Well i already found this guy who made a ScripDependencyOrdererer:

It's a pretty simple project with an implementation of IBundleOrderer:
Oct 31, 2013 at 1:29 PM
It's a completely different functionality. BundleTransformer.TypeScript can process reference comments.

We close this discussion.