{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/builder/issues/368","labels_url":"https://api.github.com/repos/systemjs/builder/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/builder/issues/368/comments","events_url":"https://api.github.com/repos/systemjs/builder/issues/368/events","html_url":"https://github.com/systemjs/builder/issues/368","id":113105337,"number":368,"title":"Builder requires modules that shouldn't be required","user":{"login":"OrKoN","id":399150,"avatar_url":"https://avatars.githubusercontent.com/u/399150?v=3","gravatar_id":"","url":"https://api.github.com/users/OrKoN","html_url":"https://github.com/OrKoN","followers_url":"https://api.github.com/users/OrKoN/followers","following_url":"https://api.github.com/users/OrKoN/following{/other_user}","gists_url":"https://api.github.com/users/OrKoN/gists{/gist_id}","starred_url":"https://api.github.com/users/OrKoN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrKoN/subscriptions","organizations_url":"https://api.github.com/users/OrKoN/orgs","repos_url":"https://api.github.com/users/OrKoN/repos","events_url":"https://api.github.com/users/OrKoN/events{/privacy}","received_events_url":"https://api.github.com/users/OrKoN/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-23T21:41:54Z","updated_at":"2015-10-24T17:23:31Z","closed_at":null,"body":"For example, if a module contains such code:\r\n\r\n```\r\n   try {\r\n        /* NPM module name */\r\n        validator = require('validator');\r\n    }\r\n    catch (e) {\r\n        /* Bower module name */\r\n        validator = require('validator-js');\r\n    }\r\n```\r\n\r\nThe builder will try to require both packages although only the first one should be required. Is it a bug or just a limitation of the builder? Does it parse the file to what needs to be required at the build time?"},"comment":{"url":"https://api.github.com/repos/systemjs/builder/issues/comments/150835676","html_url":"https://github.com/systemjs/builder/issues/368#issuecomment-150835676","issue_url":"https://api.github.com/repos/systemjs/builder/issues/368","id":150835676,"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-10-24T17:23:31Z","updated_at":"2015-10-24T17:23:31Z","body":"This is the way SystemJS bundling works - we trace all CommonJS requires statically.\r\n\r\nTo remove a require you can use map config to set it to `@empty`, either in the System config or via an override.\r\n\r\n"}}