{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/555","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/555/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/555/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/555/events","html_url":"https://github.com/systemjs/systemjs/issues/555","id":91251685,"number":555,"title":"AMD module reporting incorrect dependencies","user":{"login":"OliverJAsh","id":921609,"avatar_url":"https://avatars.githubusercontent.com/u/921609?v=3","gravatar_id":"","url":"https://api.github.com/users/OliverJAsh","html_url":"https://github.com/OliverJAsh","followers_url":"https://api.github.com/users/OliverJAsh/followers","following_url":"https://api.github.com/users/OliverJAsh/following{/other_user}","gists_url":"https://api.github.com/users/OliverJAsh/gists{/gist_id}","starred_url":"https://api.github.com/users/OliverJAsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OliverJAsh/subscriptions","organizations_url":"https://api.github.com/users/OliverJAsh/orgs","repos_url":"https://api.github.com/users/OliverJAsh/repos","events_url":"https://api.github.com/users/OliverJAsh/events{/privacy}","received_events_url":"https://api.github.com/users/OliverJAsh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-26T13:29:45Z","updated_at":"2015-06-30T14:21:55Z","closed_at":"2015-06-30T14:21:55Z","body":"We are using RequireJS to create a bundle that contains backbone:\r\n\r\n``` js\r\n// main.js\r\ndefine([ \"require\" ], function(require) {\r\n    var req = function() {\r\n        var requirejs, require, define;\r\n        return\r\n            // …\r\n            // define(\"underscore\", …),\r\n            // define(\"jquery\", …),\r\n            function(t) {\r\n                var e = \"object\" == typeof self && self.self == self && self || \"object\" == typeof global && global.global == global && global;\r\n                if (\"function\" == typeof define && define.amd) define(\"backbone\", [ \"underscore\", \"jquery\", \"exports\" ], function(n, r, i) {\r\n                    e.Backbone = t(e, i, n, r);\r\n                }); else if (\"undefined\" != typeof exports) {\r\n                    var n, r = require(\"underscore\");\r\n                    try {\r\n                        n = require(\"jquery\");\r\n                    } catch (i) {}\r\n                    t(e, exports, r, n);\r\n                } else e.Backbone = t(e, {}, e._, e.jQuery || e.Zepto || e.ender || e.$);\r\n            }(function(t, e, n, r) {})\r\n            // …\r\n    }();\r\n    return req;\r\n});\r\n```\r\n\r\n(for full code, see http://interactive.guim.co.uk/2015/05/witness-petition/assets-1432824663727/js/main.js)\r\n\r\nSystemJS seems to extract the following `metadata` from this module:\r\n\r\n```\r\ndeps: [\"underscore\", \"jquery\"],\r\nformat: \"amd\"\r\n```\r\n\r\nWhich means SystemJS will try and download `\"underscore\"` and `\"jquery\"`.\r\n\r\nIn this case, the modules are *not* dependencies of the `main` module. They are referenced as dependencies of another module (`backbone`) contained in the bundle. Are we doing some kind of static analysis that is incorrectly reading these as dependencies of `main`?"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/117205026","html_url":"https://github.com/systemjs/systemjs/issues/555#issuecomment-117205026","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/555","id":117205026,"user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars.githubusercontent.com/u/598730?v=3","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T14:21:55Z","updated_at":"2015-06-30T14:21:55Z","body":"Closing, but let me know if you have further questions here at all."}}