tiny-rjs.
Q: Yet Another RequireJS/AMD Implementation?
A: Nope.
We want to do this:
rjs;rjs;rjs;
and then:
rjsrequire 'jquery''moment''moment/locale/es'-> # $ and moment are globals $'.date-decorator'each -> $el = $this $eltext moment$eldata'date''YYYYMMDD'fromNow
AMD Support
This script loader has no support for AMD.
However you can still load simple define()
functions:
# scripts/event-bus.coffee define 'event-bus'-> EE2 = require 'eventemitter2'
Later you can require this chunk of code:
rjsrequire 'event-bus' eon 'some-event'->
The main advantage of this is encapsulating code rather that organizing your code application.
Consider the following constraints:
- TinyRJS was designed for working with existing libraries in the Bower registry.
- Most of them are namespaced or their globals are not enough harmful.
- Calling
rjs.require()
will load all scripts in sequence.
Issues
Under development. ∞