anodynos / uRequire

The Ultimate JavaScript Module Builder & Automagical Task Runner. Convert AMD & CommonJS/NodeJS modules to UMD, AMD, CommonJS or bundle them as `combined.js` (rjs & almond, AMDclean soon) & automagically run/test/watch them on nodejs, Web/AMD or Web/Script. Declarative & DRY config with inheritance. Manipulate & inject dependencies, module code, banners, version etc while building with a single line. Support two kinds of plugins, ResourceConverter (i.e file level) and AfterBuilder (i.e the whole bundle). Transparent support for Coffeescript, IcedCoffeescript, Coco, LiveScript – they’re just JavaScript :-)
http://anodynos.github.io/uRequire
MIT License
265 stars 20 forks source link

'bundle.main' should guide which Modules to convert - ignore all others #28

Open anodynos opened 11 years ago

anodynos commented 11 years ago

When you want a sub-build of your 'main' module 'ModuleA' (ususally in combined), Its inefficient in urequire 0.6, cause ALL modules are converted to AMD first, and then they used as input to rjs.optimize which picks only the dependent/referenced ones in 'ModuleA'.

uRequire should start enumerating Modules not by a glob alone, but by following dependencies of 'main', if its existent and ignoring all others.