{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/1187","repository_url":"https://api.github.com/repos/systemjs/systemjs","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/1187/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/1187/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/1187/events","html_url":"https://github.com/systemjs/systemjs/issues/1187","id":144286633,"number":1187,"title":"Q: map config override","user":{"login":"asapach","id":1755336,"avatar_url":"https://avatars.githubusercontent.com/u/1755336?v=3","gravatar_id":"","url":"https://api.github.com/users/asapach","html_url":"https://github.com/asapach","followers_url":"https://api.github.com/users/asapach/followers","following_url":"https://api.github.com/users/asapach/following{/other_user}","gists_url":"https://api.github.com/users/asapach/gists{/gist_id}","starred_url":"https://api.github.com/users/asapach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asapach/subscriptions","organizations_url":"https://api.github.com/users/asapach/orgs","repos_url":"https://api.github.com/users/asapach/repos","events_url":"https://api.github.com/users/asapach/events{/privacy}","received_events_url":"https://api.github.com/users/asapach/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-29T14:43:19Z","updated_at":"2016-03-29T15:28:27Z","closed_at":null,"body":"I have the following scenario: modules `B` and `C` depend on module `A`:\r\n```\r\nB --+\r\n    |--> A\r\nC --+\r\n```\r\nand I would like to override this dependency to module `Alpha`:\r\n```\r\nB --+\r\n    |--> Alpha\r\nC --+\r\n```\r\nBut `Alpha` needs to extend the original `A`:\r\n```\r\nB --+\r\n    |--> Alpha --> A\r\nC --+\r\n```\r\n\r\nI'm using the following pseudo-config:\r\n```\r\nSystem.config({\r\n\tpackages: {\r\n\t\t\"app\": {\r\n\t\t\tmap: {\r\n\t\t\t\t\"./A\": \"app/Alpha\"\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n```\r\n\r\nThis breaks down on this dependency: `Alpha --> A`, because it effectively becomes a cyclic dependency: `Alpha --> Alpha`. Is there a way to override it and break out?\r\n\r\nCurrently I'm using a custom `normalize` hook that does something like this:\r\n```js\r\n// Alpha.js\r\n\r\nimport A from '~/A';\r\n...\r\n```\r\nThe hook then replaces `'~/'` with the original path.\r\n\r\nIs there a better way to do this?"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/202953887","html_url":"https://github.com/systemjs/systemjs/issues/1187#issuecomment-202953887","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/1187","id":202953887,"user":{"login":"asapach","id":1755336,"avatar_url":"https://avatars.githubusercontent.com/u/1755336?v=3","gravatar_id":"","url":"https://api.github.com/users/asapach","html_url":"https://github.com/asapach","followers_url":"https://api.github.com/users/asapach/followers","following_url":"https://api.github.com/users/asapach/following{/other_user}","gists_url":"https://api.github.com/users/asapach/gists{/gist_id}","starred_url":"https://api.github.com/users/asapach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asapach/subscriptions","organizations_url":"https://api.github.com/users/asapach/orgs","repos_url":"https://api.github.com/users/asapach/repos","events_url":"https://api.github.com/users/asapach/events{/privacy}","received_events_url":"https://api.github.com/users/asapach/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T15:28:27Z","updated_at":"2016-03-29T15:28:27Z","body":"Sorry, I wanted to simplify the example and might've overdone it. `A` is a script, and I'm actually using `defaultExtension: false`, so all the modules are referenced with extensions."}}