frau-module-loader
v0.1.2
Published
A utility to allow free-range app developers to define external browserify dependencies without having to set up browserify-shim.
Downloads
2
Readme
frau-module-loader
A utility to allow free-range app developers to define external browserify dependencies without having to set up browserify-shim.
Usage
var loader = require('frau-module-loader');
module.exports = function(parent, options) {
var config = {
paths: {
'superagent': 'https://s.brightspace.com/lib/superagent/1.2.0/superagent.min'
}
};
loader(['superagent'], config, function() {
// Your app code here...
});
};
loader
takes three parameters:
deps
: The list of dependencies for your appconfig
: The requirejs config that specifies shims, paths, etc. for dependenciescallback
: The callback to start your app once requirejs has finished setup
The library also exposes the global define function so it can be used to define your own modules:
var loader = require('frau-module-loader');
loader.define('react-router-shim', ['react'], function(React) {
window.React = React;
});
Contributing
Contributions are welcome, please submit a pull request!
Code Style
This repository is configured with EditorConfig rules and contributions should make use of them.