Open matthewp opened 5 years ago
This example demonstrates:
define('one', [ 'require', 'exports', 'module', /*'two'*/ ], function (require, exports, module) { module.exports = One; One.Two = require("./two"); function One() { } }); define('two', [ 'require', 'exports', 'module', /*'one'*/ ], function (require, exports, module) { module.exports = Two; var One = require("./one"); function Two() { } Two.prototype = Object.create(One.prototype); }); define(['one']);
This code depends on the ability to define module.exports before a later function is called. This works fine in CommonJS but not in AMD-style cjs.
module.exports
This example demonstrates:
This code depends on the ability to define
module.exports
before a later function is called. This works fine in CommonJS but not in AMD-style cjs.