cujojs / cram

Simple, yet powerful, AMD and CommonJS module bundler.
http://cujojs.com
59 stars 9 forks source link

optimizer should use apiContext, apiName, defineContext, and defineName #2

Open unscriptable opened 12 years ago

unscriptable commented 12 years ago

When compiling resources/modules, the optimizer should use apiContext, apiName, defineContext, and defineName to correctly generate the compiled code. Since plugins just blindly write out "define(" in their write methods, the build tool has to compensate for this by scanning and correcting the build output.

Calls to curl( should also be converted (but not calls to require(!).

unscriptable commented 12 years ago

This issue is related to https://github.com/cujojs/curl/issues/70 since we will eventually use cram.js to build the dist versions of curl.js. cc @papirosko