{"action":"created","issue":{"url":"https://api.github.com/repos/fex-team/jello/issues/68","labels_url":"https://api.github.com/repos/fex-team/jello/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/fex-team/jello/issues/68/comments","events_url":"https://api.github.com/repos/fex-team/jello/issues/68/events","html_url":"https://github.com/fex-team/jello/issues/68","id":102936220,"number":68,"title":"js 如何 require 根目录下的资源","user":{"login":"ystarlongzi","id":2840462,"avatar_url":"https://avatars.githubusercontent.com/u/2840462?v=3","gravatar_id":"","url":"https://api.github.com/users/ystarlongzi","html_url":"https://github.com/ystarlongzi","followers_url":"https://api.github.com/users/ystarlongzi/followers","following_url":"https://api.github.com/users/ystarlongzi/following{/other_user}","gists_url":"https://api.github.com/users/ystarlongzi/gists{/gist_id}","starred_url":"https://api.github.com/users/ystarlongzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ystarlongzi/subscriptions","organizations_url":"https://api.github.com/users/ystarlongzi/orgs","repos_url":"https://api.github.com/users/ystarlongzi/repos","events_url":"https://api.github.com/users/ystarlongzi/events{/privacy}","received_events_url":"https://api.github.com/users/ystarlongzi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-25T02:35:12Z","updated_at":"2015-08-28T02:49:34Z","closed_at":"2015-08-28T02:48:08Z","body":"假设浏览器访问地址为：http://127.0.0.1/xx/aa.do\r\n\r\n文件目录如下：\r\n```\r\n-- page\r\n\t-- aa\r\n\t\t-- index.vm\r\n-- static\r\n\t-- js\r\n\t\t-- aa.js\r\n\t\t\r\n-- server.conf\r\n```\r\n\r\nserver.conf 内容如下：\r\n```\r\n## 前端目录和后端目录并不一致\r\nrewrite .*?aa\\.do /page/aa/\r\n```\r\n\r\n/page/aa/index.vm 大致内容如下：\r\n```\r\n## 注意：\r\n## 1. 页面请求地址为 http://127.0.0.1/xx/aa.do\r\n## 2. 使用的 requirejs\r\n\r\n## 方法1：\r\n#script()\r\n// 无法加载 aa.js\r\n// 发现请求地址，并不是相对于网站根目录， 而是 http://127.0.0.1/xx/static/js/aa.js\r\nrequire(['/static/js/aa.js'], function (app) {\r\n\tdebugger;\r\n});\r\n#end\r\n\r\n\r\n## 方法2：\r\n#script()\r\n// 脚本加载成功，但 app 为 undefined\r\n// 但在 jello 编译的时候会提示找不到‘ ../static/js/aa.js ’\r\nrequire(['../static/js/aa.js'], function (app) {\r\n\tdebugger;\r\n});\r\n#end\r\n```\r\n\r\n请问这种问题要怎么解决呢？"},"comment":{"url":"https://api.github.com/repos/fex-team/jello/issues/comments/135617705","html_url":"https://github.com/fex-team/jello/issues/68#issuecomment-135617705","issue_url":"https://api.github.com/repos/fex-team/jello/issues/68","id":135617705,"user":{"login":"2betop","id":2698393,"avatar_url":"https://avatars.githubusercontent.com/u/2698393?v=3","gravatar_id":"","url":"https://api.github.com/users/2betop","html_url":"https://github.com/2betop","followers_url":"https://api.github.com/users/2betop/followers","following_url":"https://api.github.com/users/2betop/following{/other_user}","gists_url":"https://api.github.com/users/2betop/gists{/gist_id}","starred_url":"https://api.github.com/users/2betop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2betop/subscriptions","organizations_url":"https://api.github.com/users/2betop/orgs","repos_url":"https://api.github.com/users/2betop/repos","events_url":"https://api.github.com/users/2betop/events{/privacy}","received_events_url":"https://api.github.com/users/2betop/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T02:49:34Z","updated_at":"2015-08-28T02:49:34Z","body":"问题出在 没有用  `#html` 标签来指定 `require.js` 而是通过 `#require` 标签引入的。导致 jello 没有输出资源转换表。"}}