{"action":"created","issue":{"url":"https://api.github.com/repos/seajs/seajs/issues/263","repository_url":"https://api.github.com/repos/seajs/seajs","labels_url":"https://api.github.com/repos/seajs/seajs/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/seajs/seajs/issues/263/comments","events_url":"https://api.github.com/repos/seajs/seajs/issues/263/events","html_url":"https://github.com/seajs/seajs/issues/263","id":5516594,"number":263,"title":"Sea.js 的调试接口","user":{"login":"lifesinger","id":97227,"avatar_url":"https://avatars.githubusercontent.com/u/97227?v=3","gravatar_id":"","url":"https://api.github.com/users/lifesinger","html_url":"https://github.com/lifesinger","followers_url":"https://api.github.com/users/lifesinger/followers","following_url":"https://api.github.com/users/lifesinger/following{/other_user}","gists_url":"https://api.github.com/users/lifesinger/gists{/gist_id}","starred_url":"https://api.github.com/users/lifesinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lifesinger/subscriptions","organizations_url":"https://api.github.com/users/lifesinger/orgs","repos_url":"https://api.github.com/users/lifesinger/repos","events_url":"https://api.github.com/users/lifesinger/events{/privacy}","received_events_url":"https://api.github.com/users/lifesinger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/seajs/seajs/labels/documentation","name":"documentation","color":"444444"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/seajs/seajs/milestones/11","html_url":"https://github.com/seajs/seajs/milestones/2.1.0","labels_url":"https://api.github.com/repos/seajs/seajs/milestones/11/labels","id":301627,"number":11,"title":"2.1.0","description":"","creator":{"login":"lifesinger","id":97227,"avatar_url":"https://avatars.githubusercontent.com/u/97227?v=3","gravatar_id":"","url":"https://api.github.com/users/lifesinger","html_url":"https://github.com/lifesinger","followers_url":"https://api.github.com/users/lifesinger/followers","following_url":"https://api.github.com/users/lifesinger/following{/other_user}","gists_url":"https://api.github.com/users/lifesinger/gists{/gist_id}","starred_url":"https://api.github.com/users/lifesinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lifesinger/subscriptions","organizations_url":"https://api.github.com/users/lifesinger/orgs","repos_url":"https://api.github.com/users/lifesinger/repos","events_url":"https://api.github.com/users/lifesinger/events{/privacy}","received_events_url":"https://api.github.com/users/lifesinger/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":42,"state":"closed","created_at":"2013-04-03T01:02:47Z","updated_at":"2013-08-13T02:01:34Z","due_on":"2013-06-30T07:00:00Z","closed_at":"2013-06-30T00:11:15Z"},"comments":14,"created_at":"2012-07-10T06:37:01Z","updated_at":"2016-05-16T05:56:39Z","closed_at":"2012-07-10T13:34:40Z","body":"# Sea.js 的调试接口\r\n\r\n使用 Sea.js，无论开发时还是上线后，调试都很方便。下面一一阐述。\r\n\r\n\r\n## seajs.cache `Object`\r\n\r\n通过 `seajs.cache`，可以查阅当前模块系统中的所有模块信息。\r\n\r\n比如，打开 [seajs.org](http://seajs.org/)，然后在 WebKit Developer Tools 的 Console 面板中输入 `seajs.cache`，可以看到：\r\n\r\n```\r\nObject\r\n  > http://seajs.org/docs/assets/main.js: x\r\n  > https://a.alipayobjects.com/jquery/jquery/1.10.1/jquery.js: x\r\n  > __proto__: Object\r\n```\r\n\r\n这些就是文档首页用到的模块。展开某一项可以看到模块的具体信息，含义可参考：[CMD 模块定义规范](https://github.com/seajs/seajs/issues/242) 中的 module 小节。\r\n\r\n\r\n## seajs.resolve `Function`\r\n\r\n类似 `require.resolve`，会利用模块系统的内部机制对传入的字符串参数进行路径解析。\r\n\r\n```js\r\n\r\nseajs.resolve('jquery');\r\n// => http://path/to/jquery.js\r\n\r\nseajs.resolve('./a', 'http://example.com/to/b.js');\r\n// => http://example.com/to/a.js\r\n\r\n```\r\n\r\n`seajs.resolve` 方法不光可以用来调试路径解析是否正确，还可以用在插件开发环境中。\r\n\r\n\r\n## seajs.require `Function`\r\n\r\n全局的 `require` 方法，可用来直接获取模块接口，比如\r\n\r\n```js\r\nseajs.use(['a', 'b'], function() {\r\n\r\n  var a = seajs.require('a')\r\n  var b = seajs.require('b')\r\n\r\n  // do something...\r\n})\r\n```\r\n\r\n\r\n## seajs.data `Object`\r\n\r\n通过 `seajs.data`，可以查看 `seajs` 所有配置以及一些内部变量的值，可用于插件开发。当加载遇到问题时，也可用于调试。\r\n\r\n\r\n## seajs.log `Function`\r\n\r\n由 seajs-log 插件提供，详见：<https://github.com/seajs/seajs-log>\r\n\r\n\r\n## seajs.find `Function`\r\n\r\n由 seajs-debug 插件提供，详见：<https://github.com/seajs/seajs-debug>\r\n\r\n\r\n\r\n---\r\n\r\nSea.js 还有 debug 插件：[seajs-debug](https://github.com/seajs/seajs-debug)\r\n\r\n有了这些方法和插件，能极大地方便开发维护，赶快试试吧。 \r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/seajs/seajs/issues/comments/219354575","html_url":"https://github.com/seajs/seajs/issues/263#issuecomment-219354575","issue_url":"https://api.github.com/repos/seajs/seajs/issues/263","id":219354575,"user":{"login":"helei2015","id":16872112,"avatar_url":"https://avatars.githubusercontent.com/u/16872112?v=3","gravatar_id":"","url":"https://api.github.com/users/helei2015","html_url":"https://github.com/helei2015","followers_url":"https://api.github.com/users/helei2015/followers","following_url":"https://api.github.com/users/helei2015/following{/other_user}","gists_url":"https://api.github.com/users/helei2015/gists{/gist_id}","starred_url":"https://api.github.com/users/helei2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helei2015/subscriptions","organizations_url":"https://api.github.com/users/helei2015/orgs","repos_url":"https://api.github.com/users/helei2015/repos","events_url":"https://api.github.com/users/helei2015/events{/privacy}","received_events_url":"https://api.github.com/users/helei2015/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T05:56:39Z","updated_at":"2016-05-16T05:56:39Z","body":"我不是很懂这个sea.config中的映射是怎么回事，请大家帮帮忙。。。"}}