require()s in the browser without a compile step
This module parses the dependency graph of modules at runtime and pre-fetches dependencies using asynchronous XMLHttp in parallel.
First write some node-style require()s:
moduleexports = 'beepity'
moduleexports = 'boop!!!'
var beep = ;var boop = ;var elem = document;eleminnerHTML = beep + ' ' + boop;
Now load up
"/js/entry.js" in some script tags.
The files that you want to load with wreq should be
You can get
wreq.js from this repository in the root directory.
index.html. That's it, no compile step and you get node-style
Now let's all stop making those ridiculous arguments that node-style
require()s necessarily entail synchronous XHR or a server-side build step
or other silliness.
wreq.min.js into your project. All done.