1.1.8 • Published 8 years ago

raptor-amd v1.1.8

Weekly downloads
4
License
Apache License v2...
Repository
github
Last release
8 years ago

raptor-amd

This modules enabled AMD in the web browser when using RaptorJS 3 by bridging the RaptorJS 3 CommonJS Module Loader with an AMD module loader.

Overview

When the code for this module is included on the page, a global require variable and a global define variable are added to the page support AMD. Internally, this module uses a bridge to the RaptorJS CommonJS module loader. This allows an AMD module to be required by a CommonJS module and vice-versa.

Installation

npm install raptor-amd --save

Usage

This module can be enabled on the page by either requiring the module:

require('raptor-amd');

Alternatively, you can add the following dependency to your page's optimizer.json:

{
    "dependencies": [
        "raptor-amd/optimizer.json"
    ]
}

If you decide to add the "raptor-amd/optimizer.json" dependency to your optimizer.json then it is not necessary to require the module.

Example

// Define a module named "foo" that exports an object with a name property:
define('foo', function(require, exports, module) {
    exports.name = 'Foo!';
});

// Dependencies can be added to an array or pulled in using require:
define('bar', ['baz'], function(baz, require, exports, module) {
    var foo = require('foo');
    // Do something with foo...
});


// You can also use the global require to load the "foo" module:
var foo = require('foo');
1.1.8

8 years ago

1.1.7

9 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.1-beta

10 years ago

1.0.0-beta

10 years ago

0.2.5-beta

10 years ago

0.2.4-beta

10 years ago

0.2.3-beta

10 years ago

0.2.2-beta

10 years ago

0.2.1-beta

10 years ago

0.2.0-beta

10 years ago