Alameda (modern RequireJS-compatible library) is bundled in CleverStyle Framework out of the box.
All other third-party libraries bundled with system like jsSHA and html5sortable are also available as AMD modules through RequireJS.
Besides Bower & NPM integration, RequireJS can be used with CleverStyle Framework components.
For instance, you have module called Experiment
and AMD module in assets/js/some-module.js
, then this module can be conveniently consumed as:
require(['Experiment/some-module'], function (some_module) {
// Do stuff
});
So in this case you don't need to specify full path to module like modules/Experiment/assets/js/some-module
, but instead can use nice short syntax.
RequireJS mappings and Bower/NPM directories can be tweaked using special event.