Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.06 KB

File metadata and controls

38 lines (24 loc) · 1.06 KB

define

Build Status

The smallest AMD JavaScript module loader! Only 1kB minified!

This is meant as a copy paste solution, so I won’t publish to npm. I like AMD because it allows rapid prototyping without any processing, unlike CommonJS where you’d need to process with a tool like webpack or browserify.

Read more about the AMD module loader here.

Caveats

It does not support:

  • Circular references (unless you manage them)
  • Anonymous modules by file reference
  • Implicit dependencies by parsing require(...) calls from functions
  • Config or plugins

If you need that you might consider something else like requirejs (15kB minified).

Minify define.js

$ npm install
$ npm run build

The output will be define.min.js

Run tests

I implemented some of the tests from amdjs/amdjs-tests, run them with:

$ npm install
$ npm run test