{"action":"opened","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/3021","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/3021/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/3021/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/3021/events","html_url":"https://github.com/webpack/webpack/issues/3021","id":177993582,"number":3021,"title":"inside the loader: get the chunk(s) file belongs too.","user":{"login":"whitecolor","id":736697,"avatar_url":"https://avatars.githubusercontent.com/u/736697?v=3","gravatar_id":"","url":"https://api.github.com/users/whitecolor","html_url":"https://github.com/whitecolor","followers_url":"https://api.github.com/users/whitecolor/followers","following_url":"https://api.github.com/users/whitecolor/following{/other_user}","gists_url":"https://api.github.com/users/whitecolor/gists{/gist_id}","starred_url":"https://api.github.com/users/whitecolor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitecolor/subscriptions","organizations_url":"https://api.github.com/users/whitecolor/orgs","repos_url":"https://api.github.com/users/whitecolor/repos","events_url":"https://api.github.com/users/whitecolor/events{/privacy}","received_events_url":"https://api.github.com/users/whitecolor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-20T08:11:25Z","updated_at":"2016-09-20T08:11:25Z","closed_at":null,"body":"**Webpack version:**\r\n2.x\r\n\r\nThis is a question on webpack internals that I don not expect to get answer on SO, so I will it here.\r\n\r\nI'm making a loader that has a following need: to get to which chunk(s) do this module belong to?\r\n\r\nSimple case:\r\n\r\n1) A System.import(B) (dynamic import, so B will be in separate chunk)\r\n2) B import C (normal import)\r\n3) C import D (normal import)\r\n\r\nSay `D` is loading using my loader, I need to figure out that it belongs not to whole A chunk, but to B chunk.\r\n\r\nI think about passing though `this.issuer[s]` and checking `reasons[n].dependency.block` to get when parent was imported using System.import or require.ensure, so it will be in a separate chunk eventually, but maybe there more reliable way to accomplish this?\r\n\r\n"}}
{"actor":{"display_login":"whitecolor"}}