A minimalist frontend resource loader that you can actually understand and extend.
725 bytes (gzip)
Notice: urw-loader is expected to be used in an environment which has Promise and common Array methods.
sample code
By default, a urw loader recognize strings as javascript file uri and load them by <script async> tags.
a simple loader
var loader = var promise1 = loader/* the timeline for above code */// ====zepto=====// ====hammer=====// ===page.js====// initPage()
use middlewares
var loader = domain: '//s0.cdn.net/' loader var promise2 = loader
loadable resources
String, function, Promise and Array are loadable.
download method
You can overwrite the URW.util.load or loader.util.load method to change the download method, e.g. when you want to load js by xhr or load css.