{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/4271","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/4271/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/4271/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/4271/events","html_url":"https://github.com/webpack/webpack/issues/4271","id":207178158,"number":4271,"title":"Allow pre/post plugin configuration for multi-page setups","user":{"login":"bebraw","id":166921,"avatar_url":"https://avatars.githubusercontent.com/u/166921?v=3","gravatar_id":"","url":"https://api.github.com/users/bebraw","html_url":"https://github.com/bebraw","followers_url":"https://api.github.com/users/bebraw/followers","following_url":"https://api.github.com/users/bebraw/following{/other_user}","gists_url":"https://api.github.com/users/bebraw/gists{/gist_id}","starred_url":"https://api.github.com/users/bebraw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bebraw/subscriptions","organizations_url":"https://api.github.com/users/bebraw/orgs","repos_url":"https://api.github.com/users/bebraw/repos","events_url":"https://api.github.com/users/bebraw/events{/privacy}","received_events_url":"https://api.github.com/users/bebraw/received_events","type":"User","site_admin":false},"labels":[{"id":1089822,"url":"https://api.github.com/repos/webpack/webpack/labels/enhancement","name":"enhancement","color":"DDDDDD","default":true},{"id":428472624,"url":"https://api.github.com/repos/webpack/webpack/labels/S2:%20Inconvenient","name":"S2: Inconvenient","color":"0052cc","default":false},{"id":90419071,"url":"https://api.github.com/repos/webpack/webpack/labels/webpack-2","name":"webpack-2","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-13T10:36:24Z","updated_at":"2017-02-15T15:02:29Z","closed_at":null,"body":"**Do you want to request a *feature* or report a *bug*?**\r\n\r\nFeature.\r\n\r\n**What is the current behavior?**\r\n\r\nIt is possible to run multiple compilations by returning an array of configurations, but there's no clear cut way to run plugins before/after them. Clean plugin is a good example of a pre-process. Deployment plugin would work post-process.\r\n\r\n**What is the expected behavior?**\r\n\r\nThere should be hooks for running plugins before and/or after the main configuration.\r\n\r\n**If this is a feature request, what is motivation or use case for changing the behavior?**\r\n\r\nHaving an opinion on this would make it clearer to deal with the use case (clean, compile, deploy) when using a multi-page setup.\r\n\r\nA good way to implement could be to allow configuration like this:\r\n\r\n```javascript\r\nmodule.exports = [\r\n  { // pre-process\r\n    plugins: [\r\n      ...\r\n    ]\r\n  },\r\n  { ... }, // regular config\r\n  { // post-process\r\n    plugins: [\r\n      ..\r\n    ]\r\n  }\r\n];\r\n```\r\n\r\nPre/post-process could be detected based on configuration shape."},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/280034202","html_url":"https://github.com/webpack/webpack/issues/4271#issuecomment-280034202","issue_url":"https://api.github.com/repos/webpack/webpack/issues/4271","id":280034202,"user":{"login":"sokra","id":1365881,"avatar_url":"https://avatars.githubusercontent.com/u/1365881?v=3","gravatar_id":"","url":"https://api.github.com/users/sokra","html_url":"https://github.com/sokra","followers_url":"https://api.github.com/users/sokra/followers","following_url":"https://api.github.com/users/sokra/following{/other_user}","gists_url":"https://api.github.com/users/sokra/gists{/gist_id}","starred_url":"https://api.github.com/users/sokra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sokra/subscriptions","organizations_url":"https://api.github.com/users/sokra/orgs","repos_url":"https://api.github.com/users/sokra/repos","events_url":"https://api.github.com/users/sokra/events{/privacy}","received_events_url":"https://api.github.com/users/sokra/received_events","type":"User","site_admin":false},"created_at":"2017-02-15T15:02:29Z","updated_at":"2017-02-15T15:02:29Z","body":"webpack describe the build process in a declarative way. Clean, Deployment, Preprocess and Postprocess are imperative steps. webpack is not a taskrunner like gulp, grunt, npm scripts. These describe a process in an imperative way.\r\n\r\nThe recommended way to use preprocessing and postprocessing is to use a task runner. I. e. \r\n\r\n``` js\r\n\"scripts\": {\r\n  \"build\": \"rm -rf build && webpack && npm run deploy\"\r\n}\r\n```"}}
{"actor":{"display_login":"sokra"}}