Fork me on GitHub

Features

Features at a glance

Module Authoring

  • UMD conversion based on a 'familiar' standardized UMD template with optional global exports based on returnExportsGlobal.js. Also it converts to native nodejs or AMD - the latter usefull for r.js optimization & bundling. Finally a 'combined' template optimizes your whole bundle in one combined.js ready for deployment anywhere.

    • Accomodates both define() and require() to work the same way in both browser & node.

      • Specifically, the browser AMD-style require([..], function(..){}) works on nodejs, just as it does on the browser: asynchronously.

      • And vise versa, the node-style var a = require('a') also works on browser (at least seemingly) synchronously.

      • Finally, define is 'worked' inside UMD to behave as expected on both web & nodejs.

  • Automatically fills missing require('') dependencies from [], that would otherwise halt your app @ runtime, since requirejs scan is off.

  • Resolves paths dependencies between formats, allowing modules to transparently have a bundle-root as a reference point (eg models\PersonModel) that works in both Web/AMD and nodejs.

  • Declaratively generates the boilerplate for rootExports (global variables to export, eg '_', '$' etc), from a simple declarative setting, on any module. Additionally noConflict() boilerplate code can be produced on any module, again declarativelly.

Deployment

  • Checks your dependencies are valid at build time, so they work right at run time. It identifies dependencies within bundle boundaries and whether those exist. It also identifies and works with 'globals', 'externals', 'webRootMap', 'requireJS baseUrl/paths' etc. In future versions uRequire will check their validity/existence, before deploying.

  • Use requireJs loader plugins everywhere, Web or nodejs.

  • UMD Requires no additional dependency on Web AMD/RequireJs. On nodejs you 'll need npm install urequire to execute UMD modules, which gives you extra deployment functionality.

  • Easily build a combined .js file of your bundle that runs on Web/Script, Web/AMD and nodejs without any dependencies.

  • Declare bundle exported dependencies that are available through the bundle. In combined template they are available through the closure, to save size from being define/require -ed in each module.

  • Also when your module is written in a coffee* family language and is using the AMD define() format, all generated code like __extends, __slice or __curry$ (that goes outside the define() when compiled with coffee/coco/ls etc) is included only once in combined template again to reduce size.

Development & Buidling

  • Embedded support support for coffeescript, Livescript, coco and icedcoffeescript so you can write your modules in either without configuring anything.

  • The 1st and only Modules & dependencies aware build system; works standalone or with Grunt.

  • A wicked, extendible, inheritance-aware configuration format that allows fine grained control over your bundle definition & expected build.

  • Watch your building process, automatically converting, building, copying etc only changed files.

  • Resource Converters, a powerful and extendible in-memory conversions workflow, flexible enough to cater for all your conversions needs.

  • Manipulate Modules before the final template conversion: you can inject, replace or remove dependencies and even replace or remove code fragments.