0.1.2 • Published 10 years ago

frau-module-loader v0.1.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
10 years ago

frau-module-loader

NPM version Build status Dependency Status

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 app
  • config: The requirejs config that specifies shims, paths, etc. for dependencies
  • callback: 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.

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago