0.1.0 • Published 10 years ago
promethify v0.1.0
promethify
Browserify v2 transform to require AMD style and async fetch bundles with minimal configuration
scriptjs is a required dependency to use this transform. npm install --save scriptjs
Usage
//foo.js
console.log(window.loaded) // undefined
require(['/bar'], function(bar){
console.log(bar.hello); // async fetch the bar bundle and log 'world'
console.log(window.loaded); // true
});
//bar.js
module.exports = {hello: 'world'};
window.loaded = true;
Configuration
"promethify": {
"basedir": "test",
"port": 8087
}
Configuration is provided through the package.json of your project. There are two required properties.
basedir
This option is the path from the package.json of your project that you want to use for lookups when requiring files asynchronously.port
This option is the port number that you want the server that asynchronously fetches the new bundles to bind to.