{"action":"created","issue":{"url":"https://api.github.com/repos/Klathmon/imagemin-webpack-plugin/issues/6","repository_url":"https://api.github.com/repos/Klathmon/imagemin-webpack-plugin","labels_url":"https://api.github.com/repos/Klathmon/imagemin-webpack-plugin/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/Klathmon/imagemin-webpack-plugin/issues/6/comments","events_url":"https://api.github.com/repos/Klathmon/imagemin-webpack-plugin/issues/6/events","html_url":"https://github.com/Klathmon/imagemin-webpack-plugin/issues/6","id":169371403,"number":6,"title":"Can it work together with copy-webpack-plugin?","user":{"login":"colthreepv","id":2657230,"avatar_url":"https://avatars.githubusercontent.com/u/2657230?v=3","gravatar_id":"","url":"https://api.github.com/users/colthreepv","html_url":"https://github.com/colthreepv","followers_url":"https://api.github.com/users/colthreepv/followers","following_url":"https://api.github.com/users/colthreepv/following{/other_user}","gists_url":"https://api.github.com/users/colthreepv/gists{/gist_id}","starred_url":"https://api.github.com/users/colthreepv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colthreepv/subscriptions","organizations_url":"https://api.github.com/users/colthreepv/orgs","repos_url":"https://api.github.com/users/colthreepv/repos","events_url":"https://api.github.com/users/colthreepv/events{/privacy}","received_events_url":"https://api.github.com/users/colthreepv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-04T13:15:11Z","updated_at":"2016-08-04T16:13:10Z","closed_at":null,"body":"It would be bliss if those plugins could work together, so to copy images and compress them.\r\n\r\nDo you have any idea how to accomplish this?"},"comment":{"url":"https://api.github.com/repos/Klathmon/imagemin-webpack-plugin/issues/comments/237602955","html_url":"https://github.com/Klathmon/imagemin-webpack-plugin/issues/6#issuecomment-237602955","issue_url":"https://api.github.com/repos/Klathmon/imagemin-webpack-plugin/issues/6","id":237602955,"user":{"login":"Klathmon","id":1879551,"avatar_url":"https://avatars.githubusercontent.com/u/1879551?v=3","gravatar_id":"","url":"https://api.github.com/users/Klathmon","html_url":"https://github.com/Klathmon","followers_url":"https://api.github.com/users/Klathmon/followers","following_url":"https://api.github.com/users/Klathmon/following{/other_user}","gists_url":"https://api.github.com/users/Klathmon/gists{/gist_id}","starred_url":"https://api.github.com/users/Klathmon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Klathmon/subscriptions","organizations_url":"https://api.github.com/users/Klathmon/orgs","repos_url":"https://api.github.com/users/Klathmon/repos","events_url":"https://api.github.com/users/Klathmon/events{/privacy}","received_events_url":"https://api.github.com/users/Klathmon/received_events","type":"User","site_admin":false},"created_at":"2016-08-04T16:13:10Z","updated_at":"2016-08-04T16:13:10Z","body":"It's possible, but it looks like it will require changes in `copy-webpack-plugin`.\r\n\r\nMy plugin works in the `compilation` phase of the compiler in webpack. Unfortunately it looks like the `copy-webpack-plugin` does all of it's work in the `emit` phase of the compiler (which happens after my plugin is done).\r\n\r\nThat being said, it looks like `copy-webpack-plugin` works by adding the files to the webpack `assets` array and lets webpack write them to the output directory. This means that if `copy-webpack-plugin` is modified to run in a phase before `compilation` (specifically the `this-compilation` event that I use here), then my plugin will automatically start optimizing any images it adds.\r\n\r\n\r\nNow the docs for webpack plugins are awful, and it looks like the author of `copy-webpack-plugin` knows more about it than I do, so there is a good chance that his plugin is working on the correct event and mine needs to be modified to a later event like `emit`. (If you or anyone else knows the answer to this, please let me know!).\r\n\r\nSo the TL;DR to my rambling is:\r\n\r\nIt's possible, and it shouldn't be too much work, but it will require changes in one of our plugins, and i'm not sure which..."}}
{"actor":{"display_login":"Klathmon"}}