{"action":"opened","issue":{"url":"https://api.github.com/repos/rollup/rollup/issues/2043","repository_url":"https://api.github.com/repos/rollup/rollup","labels_url":"https://api.github.com/repos/rollup/rollup/issues/2043/labels{/name}","comments_url":"https://api.github.com/repos/rollup/rollup/issues/2043/comments","events_url":"https://api.github.com/repos/rollup/rollup/issues/2043/events","html_url":"https://github.com/rollup/rollup/issues/2043","id":304063883,"number":2043,"title":"transformChunk hook","user":{"login":"guybedford","id":598730,"avatar_url":"https://avatars1.githubusercontent.com/u/598730?v=4","gravatar_id":"","url":"https://api.github.com/users/guybedford","html_url":"https://github.com/guybedford","followers_url":"https://api.github.com/users/guybedford/followers","following_url":"https://api.github.com/users/guybedford/following{/other_user}","gists_url":"https://api.github.com/users/guybedford/gists{/gist_id}","starred_url":"https://api.github.com/users/guybedford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guybedford/subscriptions","organizations_url":"https://api.github.com/users/guybedford/orgs","repos_url":"https://api.github.com/users/guybedford/repos","events_url":"https://api.github.com/users/guybedford/events{/privacy}","received_events_url":"https://api.github.com/users/guybedford/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-10T11:36:08Z","updated_at":"2018-03-10T11:36:08Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Thinking about things like having CSS imports work with Code Splitting (again, totally not inspired by other project work), the standard thing a plugin needs is the ability to \"reduce\" or optimize the CSS for that specific chunk. So it needs a list of ids of what is in the chunk, the chunk source, and then to output some kind of reduction, or to write its own css file etc.\r\n\r\nCurrently we have the `transformBundle` hook called for each chunk, so that it is effectively a `transformChunk` hook now, but it is missing the following information:\r\n\r\n* The list of modules in the chunk\r\n* The output file name of the current chunk\r\n\r\nSo what I'd like to suggest is:\r\n\r\na) Create a new `transformChunk` interface designed specifically for this purpose. Something like `transformChunk (chunkFileName: string, ids: string[], source, sourceMapChain, outputOptions)`.\r\nb) Consider deprecating `transformBundle` for `transformChunk` in future.\r\n\r\nSo it's effectively an upgrade path for `transformBundle` to deal with code splitting \"reductions\"."}}
{"actor":{"display_login":"guybedford"}}