main.js
define(function(require, exports, module) {
var person = require("../test/test2.js");
var module3 = require("../test/test3.js");
var main = {}
main.init = function(){
module3.init();
}
module.exports = main;
});
test1.js
define(function(require, exports, module) {
var object = {};
module.exports = object;
});
test2.js
define(function(require, exports, module) {
var module1 = require("./test1");
var object = {"name":"lifeixiang"};
module1.preson = object;
module.exports = object;
});
test3.js
define(function(require, exports, module) {
var module1 = require("./test1");
var object = {};
object.init = function(){
console.log(module1.preson)
}
module.exports = object;
});