// package/lib is a dependency we requirevar lib = require( "package/lib" );
// behavior for our modulefunction foo(){lib.log( "hello world!" );}
// export (expose) foo to other modules as foobarexports.foobar = foo;
AMD兼容:
// package/lib is a dependency we requiredefine(["package/lib"], function (lib) {
// behavior for our modulefunction foo() {lib.log( "hello world!" );}
// export (expose) foo to other modules as foobarreturn {foobar: foo}});