{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/298","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/298/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/298/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/298/events","html_url":"https://github.com/systemjs/systemjs/issues/298","id":53511419,"number":298,"title":"Swapping modules - need to use normalized name","user":{"login":"marcfallows","id":2862984,"avatar_url":"https://avatars.githubusercontent.com/u/2862984?v=3","gravatar_id":"","url":"https://api.github.com/users/marcfallows","html_url":"https://github.com/marcfallows","followers_url":"https://api.github.com/users/marcfallows/followers","following_url":"https://api.github.com/users/marcfallows/following{/other_user}","gists_url":"https://api.github.com/users/marcfallows/gists{/gist_id}","starred_url":"https://api.github.com/users/marcfallows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcfallows/subscriptions","organizations_url":"https://api.github.com/users/marcfallows/orgs","repos_url":"https://api.github.com/users/marcfallows/repos","events_url":"https://api.github.com/users/marcfallows/events{/privacy}","received_events_url":"https://api.github.com/users/marcfallows/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-01-06T12:45:35Z","updated_at":"2015-01-07T10:26:08Z","closed_at":null,"body":"I'm having some trouble with a module that I want to swap out based on some config.\r\n\r\n``` javascript\r\nSystem.config({\r\n   \"versions\": {\r\n      \"lib/sdk\": \"0.1.2\"\r\n   }\r\n});\r\nSystem.import('main');\r\n```\r\n\r\nThere's a case I want everything which asks for `aModule` to give me `aMockModule`.\r\n\r\n``` javascript\r\n// main.js\r\nrequire(['lib/sdk/aModule'], function(aModule) {\r\n   // aModule should be aMockModule\r\n});\r\n```\r\n\r\n``` javascript\r\n// lib/sdk@0.1.2/utils/differentModule.js\r\nrequire(['../aModule'], function(aModule) {\r\n   // aModule should also be aMockModule\r\n});\r\n```\r\n\r\nAt this point I can only seem to get it to work if I do the following:\r\n``` javascript\r\nSystem.config({\r\n   \"paths\": {\r\n      \"lib/sdk@0.1.2/aModule\": \"lib/sdk@0.1.2/aMockModule.js\"\r\n   }\r\n});\r\n```\r\n\r\nThis works, but if I upgrade versions of the sdk, then I need to change the config, which doesn't seem right. Also, I feel like it should be something I can do with `meta`, but I'm not sure how (and `meta` would need to include the normalized name with version... again, doesn't feel right).\r\n\r\nAm I missing something in terms of the configuration options? Would there be a way to apply this regardless of version so the config does not need to be updated?"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/69003653","html_url":"https://github.com/systemjs/systemjs/issues/298#issuecomment-69003653","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/298","id":69003653,"user":{"login":"marcfallows","id":2862984,"avatar_url":"https://avatars.githubusercontent.com/u/2862984?v=3","gravatar_id":"","url":"https://api.github.com/users/marcfallows","html_url":"https://github.com/marcfallows","followers_url":"https://api.github.com/users/marcfallows/followers","following_url":"https://api.github.com/users/marcfallows/following{/other_user}","gists_url":"https://api.github.com/users/marcfallows/gists{/gist_id}","starred_url":"https://api.github.com/users/marcfallows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcfallows/subscriptions","organizations_url":"https://api.github.com/users/marcfallows/orgs","repos_url":"https://api.github.com/users/marcfallows/repos","events_url":"https://api.github.com/users/marcfallows/events{/privacy}","received_events_url":"https://api.github.com/users/marcfallows/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T10:26:08Z","updated_at":"2015-01-07T10:26:08Z","body":"I'm not running multiple versions of angular, but regularly updating to try and stick with their releases. But, the wildcard meta approach could actually cope with multiple versions since I could specify an exact version if I needed different meta. That meta would be more specific, and hence prioritize over the generic angular meta.\r\n\r\n`paths` wouldn't work unfortunately, since I have `\"lib/*\"` already as a path.\r\n\r\nSeems like specifying the version numbers explicitly in the meta works for now, and then I can clean up the config once there is wildcard meta.\r\n\r\nCan I help with that feature or is it well under way?"}}