{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/1382","repository_url":"https://api.github.com/repos/systemjs/systemjs","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/1382/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/1382/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/1382/events","html_url":"https://github.com/systemjs/systemjs/issues/1382","id":168135475,"number":1382,"title":"Unable to load bundled builds from a remote package","user":{"login":"thekhoi","id":3824546,"avatar_url":"https://avatars.githubusercontent.com/u/3824546?v=3","gravatar_id":"","url":"https://api.github.com/users/thekhoi","html_url":"https://github.com/thekhoi","followers_url":"https://api.github.com/users/thekhoi/followers","following_url":"https://api.github.com/users/thekhoi/following{/other_user}","gists_url":"https://api.github.com/users/thekhoi/gists{/gist_id}","starred_url":"https://api.github.com/users/thekhoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thekhoi/subscriptions","organizations_url":"https://api.github.com/users/thekhoi/orgs","repos_url":"https://api.github.com/users/thekhoi/repos","events_url":"https://api.github.com/users/thekhoi/events{/privacy}","received_events_url":"https://api.github.com/users/thekhoi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-28T16:11:58Z","updated_at":"2016-08-01T12:35:07Z","closed_at":null,"body":"I'm trying to load an angular package from a remote CDN URL. The angular assets are compiled w/ the angular CLI using the -prod flag.  This will generate named modules:\r\n\r\n`System.register(\"main.js\",[],function(a,b){...});`\r\n\r\nThe following is from the system-config file in the host application (http://localhost:4200).\r\n\r\n```\r\n{\r\n  map: {'sharedcomponent':'http://mycdn.com/shared-component'}\r\n  packages: {\r\n    \"http://mycdn.com/shared-component\": {\r\n      \"main\": \"main.js\",\r\n      \"meta\": {\r\n        \"*\": {\r\n          \"format\": \"system\",\r\n          \"scriptLoad\": true\r\n      }\r\n    }\r\n  }\r\n```\r\nThe host application is later importing the component returns an empty object.\r\n\r\n```\r\nSystem.import('sharedcomponent')\r\n  .then(function(comp){\r\n    console.log(comp); //outputs {}\r\n  });\r\n```\r\n\r\nWhen inspecting SystemJS.defined in the console, I can see all the bundled modules loaded under the 'localhost:4200' domain rather than the CDN domain.\r\n\r\nHowever if I deploy a non bundled build with anonymous modules, every thing loads correctly.\r\n\r\nCan anyone provide any insight? Is this an issue w/ the systemjs or the angular CLI?"},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/236568489","html_url":"https://github.com/systemjs/systemjs/issues/1382#issuecomment-236568489","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/1382","id":236568489,"user":{"login":"thekhoi","id":3824546,"avatar_url":"https://avatars.githubusercontent.com/u/3824546?v=3","gravatar_id":"","url":"https://api.github.com/users/thekhoi","html_url":"https://github.com/thekhoi","followers_url":"https://api.github.com/users/thekhoi/followers","following_url":"https://api.github.com/users/thekhoi/following{/other_user}","gists_url":"https://api.github.com/users/thekhoi/gists{/gist_id}","starred_url":"https://api.github.com/users/thekhoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thekhoi/subscriptions","organizations_url":"https://api.github.com/users/thekhoi/orgs","repos_url":"https://api.github.com/users/thekhoi/repos","events_url":"https://api.github.com/users/thekhoi/events{/privacy}","received_events_url":"https://api.github.com/users/thekhoi/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T12:35:07Z","updated_at":"2016-08-01T12:35:07Z","body":"Well this is a problem then. This would mean you have to namespace everything that needs to be shared. You wouldn't be able to import using relative paths even in the same package if you intend to load the package from a remote host.\r\n\r\nIs this why the angular team stopped hosting angular builds on code.angularjs.org when they started using relative paths?\r\n"}}
{"actor":{"display_login":"thekhoi"}}