Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // run.js
- var requirejs = require('requirejs');
- requirejs.config({
- baseUrl: __dirname,
- nodeRequire: require
- });
- requirejs(['A'], function(A) {
- var a = new A.Go();
- console.log(a.toon())
- });
- // A.js
- define(['B', 'exports'], function(B, exports) {
- exports.Go = function() {
- var b = new require('B').Ho();
- var toon = function() {
- return 'me tarzan';
- };
- return {
- b: b,
- toon: toon
- }
- };
- });
- // B.js
- define(['A', 'exports'], function(A, exports) {
- exports.Ho = function() {
- var a = new require('A').Go();
- var show = function() {
- return 'you jane';
- }
- return {
- a: a,
- show: show
- }
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement