BundleTransformer.TypeScript CommonJS module support

Oct 30, 2013 at 1:29 PM
Edited Oct 30, 2013 at 5: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.
Coordinator
Oct 31, 2013 at 9: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 12:21 PM
Well i already found this guy who made a ScripDependencyOrdererer: http://blog.anderson.geek.nz/2013/02/26/sorting-a-scriptbundle-based-on-reference-tags/

It's a pretty simple project with an implementation of IBundleOrderer: https://github.com/arraybracket/bundling
Coordinator
Oct 31, 2013 at 12:29 PM
It's a completely different functionality. BundleTransformer.TypeScript can process reference comments.

We close this discussion.