Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

seamus-oconnor/micro-amd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micro AMD Loader is a very small (1.4kb minified & gzipped) AMD loader. It is not as feature-full as RequireJS but it loads AMD formated modules in the same manner.

Example:

Load a "foo.js" in the same directory as this executing script.

require(['foo'], function(foo) {
  alert(foo);
});

Configure a different baseUrl to resolve all module names against.

require.config({
  baseUrl: 'js/'
});
// Loads js/foo.js
require(['foo'], function(foo) {
  alert(foo);
});

Configure a different path to load modules from.

require.config({
  paths: {
    lib: 'js/modules'
  }
});
// Loads js/modules/foo.js
require(['lib/foo'], function(foo) {
  alert(foo);
});