{"action":"created","issue":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/1313","repository_url":"https://api.github.com/repos/systemjs/systemjs","labels_url":"https://api.github.com/repos/systemjs/systemjs/issues/1313/labels{/name}","comments_url":"https://api.github.com/repos/systemjs/systemjs/issues/1313/comments","events_url":"https://api.github.com/repos/systemjs/systemjs/issues/1313/events","html_url":"https://github.com/systemjs/systemjs/issues/1313","id":159909026,"number":1313,"title":"Bundle inject (not) using mapped paths","user":{"login":"sergei-maertens","id":5518550,"avatar_url":"https://avatars.githubusercontent.com/u/5518550?v=3","gravatar_id":"","url":"https://api.github.com/users/sergei-maertens","html_url":"https://github.com/sergei-maertens","followers_url":"https://api.github.com/users/sergei-maertens/followers","following_url":"https://api.github.com/users/sergei-maertens/following{/other_user}","gists_url":"https://api.github.com/users/sergei-maertens/gists{/gist_id}","starred_url":"https://api.github.com/users/sergei-maertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergei-maertens/subscriptions","organizations_url":"https://api.github.com/users/sergei-maertens/orgs","repos_url":"https://api.github.com/users/sergei-maertens/repos","events_url":"https://api.github.com/users/sergei-maertens/events{/privacy}","received_events_url":"https://api.github.com/users/sergei-maertens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-13T09:35:15Z","updated_at":"2016-06-15T06:45:05Z","closed_at":null,"body":"Versions:\r\n* jspm 0.17-beta.17\r\n* SystemJS 0.19.29 (same with 0.19.31)\r\n\r\nConfirmed working versions:\r\n* jspm 0.17-beta.12\r\n* SystemJS 0.19.25\r\n\r\nRelevant config:\r\n\r\n```\r\n// jspm.config.js\r\nSystemJS.config({\r\n  paths: {\r\n    \"npm:\": \"jspm_packages/npm/\",\r\n    \"github:\": \"jspm_packages/github/\",\r\n    \"imtool/\": \"js/\"\r\n  },\r\n  packages: {\r\n    \"imtool\": {\r\n      \"format\": \"esm\",\r\n      \"main\": \"main.js\",\r\n      \"meta\": {\r\n        \"*.js\": {\r\n          \"loader\": \"plugin-babel\",\r\n          \"babelOptions\": {\r\n            \"plugins\": [\r\n              \"babel-plugin-transform-react-jsx\",\r\n              \"babel-plugin-transform-class-properties\"\r\n            ]\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n});\r\n```\r\n\r\n```\r\n// jspm.browser.js\r\nSystemJS.config({\r\n  baseURL: \"/static\",\r\n  bundles: {\r\n    \"SYSTEMJS/build/router.js\": [\r\n      \"imtool/router.js\",\r\n      \"imtool/projects/ProjectSetupView.js\",\r\n      \"imtool/projects/project-setup.js\",\r\n      ...\r\n  }\r\n});\r\n```\r\n\r\nWatch bundle created with:\r\n```\r\njspm bundle imtool/router.js staticfiles/SYSTEMJS/build/router.js -wid\r\n```\r\n\r\nObserved behaviour (in system.src.js, `hook('locate', ...)` w/r to bundles:\r\n\r\nThe `load.name` is normalize to `\"http://localhost:8000/static/js/router.js\"`, while the bundle entry is `\"http://localhost:8000/static/imtool/router.js\"`. Obviously these two don't match, causing the bundle not to be injected.\r\n\r\nThe requested resource URL is fine, it feels that the bundle-configuration should apply the path mapping (might be related to #1230).\r\n\r\nOn beta.12, it seems like the bundle config is loaded anyway, in my debugger it seems to be the first hit anyway."},"comment":{"url":"https://api.github.com/repos/systemjs/systemjs/issues/comments/226101834","html_url":"https://github.com/systemjs/systemjs/issues/1313#issuecomment-226101834","issue_url":"https://api.github.com/repos/systemjs/systemjs/issues/1313","id":226101834,"user":{"login":"sergei-maertens","id":5518550,"avatar_url":"https://avatars.githubusercontent.com/u/5518550?v=3","gravatar_id":"","url":"https://api.github.com/users/sergei-maertens","html_url":"https://github.com/sergei-maertens","followers_url":"https://api.github.com/users/sergei-maertens/followers","following_url":"https://api.github.com/users/sergei-maertens/following{/other_user}","gists_url":"https://api.github.com/users/sergei-maertens/gists{/gist_id}","starred_url":"https://api.github.com/users/sergei-maertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergei-maertens/subscriptions","organizations_url":"https://api.github.com/users/sergei-maertens/orgs","repos_url":"https://api.github.com/users/sergei-maertens/repos","events_url":"https://api.github.com/users/sergei-maertens/events{/privacy}","received_events_url":"https://api.github.com/users/sergei-maertens/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T06:45:05Z","updated_at":"2016-06-15T06:45:05Z","body":"Same thing with .21. On .12 it appears that the bundles themselves are\nalways loaded first, even before a bundled module was requested.\n\nIt's not fetching the bundle file - the lookup starts for one of my\nmodules, say 'imtool/router.js'. This gets normalized to\nhttp://localhost:8000/static/js/router.js, but the normalized bundle config\ncontains http://localhost:8000/static/imtool/router.js. It never matches,\nso the bundle file is never loaded.\n\nCurrently on mobile, in two hours or so I can show some more code that is\nour current workaround.\nOn Jun 15, 2016 1:20 AM, \"Guy Bedford\" <notifications@github.com> wrote:\n\n> Can you try this in 0.17.0-beta.21?\n>\n> So it's fetching the bundle file, and then requesting the module again? Or\n> is it not even requesting the bundle to begin with?\n>\n> The names in the bundle config look correct, if they're the same names\n> used in the bundle itself that all sounds right to me. Then just ensuring\n> the configuration is loaded before the bundle as well.\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/systemjs/systemjs/issues/1313#issuecomment-226045351>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe/AFQ01mWJt7CpZBANwoWzyyy5vHXUfTbrks5qLzdQgaJpZM4I0JnH>\n> .\n>\n"}}
{"actor":{"display_login":"sergei-maertens"}}