lib.js 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. if (typeof define !== 'function') { var define = require('../../amdefine')(module) }
  2. define('sub/nested/d', function (require, exports, module) {
  3. var c = require('../c'),
  4. e = require('./e'),
  5. // if sub/nested/other is not defined, look for a file called
  6. // other.js in the current directory
  7. other = require('./other');
  8. return {
  9. name: 'd',
  10. e: e,
  11. cName: c.name,
  12. otherName: other.name
  13. };
  14. });
  15. define('sub/nested/e', function (require, exports) {
  16. exports.name = 'e';
  17. });
  18. define('b', {
  19. name: 'b'
  20. });
  21. define('sub/c', function (require, exports, module) {
  22. //A fake out, modify the exports, but still prefer the
  23. //return value as the module value.
  24. exports.name = 'badc';
  25. return {
  26. name: 'c'
  27. };
  28. });
  29. define('lib', ['./b', './sub/nested/d'], function (b, d) {
  30. return {
  31. name: 'lib',
  32. b: b,
  33. d: d
  34. };
  35. });
  36. module.exports = define.require('lib');