The module exporting and importing syntax that we have used thus far uses what is known as the CommonJS syntax, and is the default mechanism for module loading when using Node. Traditionally, this module loading syntax was not available for use within a browser, and as such, an alternative to CommonJS became popular, named Asynchronous Module Definition, or AMD. One of the most prevalent libraries to use AMD is RequireJS, or simply Require. In this section, we will reuse the source code for the modules we created in Node, and recompile them for use with AMD. We will then show how to use Require to load these modules in the browser.
AMD module loading
AMD compilation
In order to compile our code to use the AMD module syntax...