Closed arnaud-lb closed 13 years ago
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA.
Apologies, but this module is for browserify, hence the browserify in the title. I have no interest in the asynchronous require() style.
this module is for browserify, hence the browserify in the title
ok, missed that
I have no interest in the asynchronous require() style
Why ? I found it to really make development easier, just add a require and your modules are loaded. If an error occur during execution the browser reports the correct file/line number and all.
You can still pack a module and all its dependencies in a single file for production (requirejs provides a tool that does this), so the result in production is the same.
The point of this module and also of browserify is to emulate the node.js environment for browser code. Node.js doesn't use asynchronous require() and so this module doesn't either.
AsynchronousDefinition would allow to load the lib asynchronously in the browser:
http://requirejs.org/ and other asynchronous loaders support this.
In the library, this consists of wrapping all the code in a function that will be called by the loader when appropriate (after all dependencies are loaded, etc):