{"action":"created","issue":{"url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/321","repository_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin","labels_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/321/labels{/name}","comments_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/321/comments","events_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/321/events","html_url":"https://github.com/webpack-contrib/mini-css-extract-plugin/pull/321","id":388165883,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NDkxODgy","number":321,"title":"Feat/filename transform","user":{"login":"kevinchappell","id":1457540,"node_id":"MDQ6VXNlcjE0NTc1NDA=","avatar_url":"https://avatars2.githubusercontent.com/u/1457540?v=4","gravatar_id":"","url":"https://api.github.com/users/kevinchappell","html_url":"https://github.com/kevinchappell","followers_url":"https://api.github.com/users/kevinchappell/followers","following_url":"https://api.github.com/users/kevinchappell/following{/other_user}","gists_url":"https://api.github.com/users/kevinchappell/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinchappell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinchappell/subscriptions","organizations_url":"https://api.github.com/users/kevinchappell/orgs","repos_url":"https://api.github.com/users/kevinchappell/repos","events_url":"https://api.github.com/users/kevinchappell/events{/privacy}","received_events_url":"https://api.github.com/users/kevinchappell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-12-06T11:12:10Z","updated_at":"2018-12-18T18:18:09Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/pulls/321","html_url":"https://github.com/webpack-contrib/mini-css-extract-plugin/pull/321","diff_url":"https://github.com/webpack-contrib/mini-css-extract-plugin/pull/321.diff","patch_url":"https://github.com/webpack-contrib/mini-css-extract-plugin/pull/321.patch"},"body":"<!--\r\n  HOLY CRAP a Pull Request. We ❤️ those!\r\n\r\n  If you remove or skip this template, you'll make the 🐼 sad and the mighty god\r\n  of Github will appear and pile-drive the close button from a great height\r\n  while making animal noises.\r\n\r\n  Please place an x (no spaces!) in all [ ] that apply\r\n-->\r\n\r\nThis PR contains a:\r\n\r\n- [ ] **bugfix**\r\n- [x] new **feature**\r\n- [ ] **code refactor**\r\n- [x] **test update** <!-- if bug or feature is checked, this should be too -->\r\n- [ ] **typo fix**\r\n- [ ] **metadata update**\r\n\r\n### Motivation / Use-Case\r\n\r\nThe `filename` option currently takes a string the enables devs to customize the filename of the generated css file. This works well and the customized filename is created in the same output directory as the js file it is extracted from, however there are cases when the generated files may need to be in different directories. This change enables modifying the `filenameTemplate` by providing `chunkhash`, `contenthash`, `name`, and `id` as arguments when a function is used for the `filename` option instead of a string.\r\n\r\n#### Use Case:\r\nwebpack.config.js - `entry`\r\n```javascript\r\n  entry: {\r\n    'dist/main': 'src/index.js',\r\n    'demo/assets/js/demo': 'src/demo/index.js',\r\n  }\r\n```\r\nThe above config will create `dist/main.js` and `demo/assets/js/demo.js`.\r\n\r\n#### Use:\r\nwebpack.config.js - `plugins`\r\n```javascript\r\n  plugins: [\r\n    new MiniCssExtractPlugin({\r\n      filename: ({ name }) => `${name.replace('/js/', '/css/')}.min.css`,\r\n    })\r\n  ]\r\n```\r\nWe can change the output directory, chunkhash length and more by using a function that gets called during `compilation.mainTemplate.hooks.renderManifest`.\r\n\r\n### Breaking Changes\r\n\r\nMost likely none\r\n\r\n### Additional Info\r\nImproved some existing tests. Now testing filename and path generation."},"comment":{"url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/comments/448318146","html_url":"https://github.com/webpack-contrib/mini-css-extract-plugin/pull/321#issuecomment-448318146","issue_url":"https://api.github.com/repos/webpack-contrib/mini-css-extract-plugin/issues/321","id":448318146,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODMxODE0Ng==","user":{"login":"domonique-ncino","id":27729325,"node_id":"MDQ6VXNlcjI3NzI5MzI1","avatar_url":"https://avatars2.githubusercontent.com/u/27729325?v=4","gravatar_id":"","url":"https://api.github.com/users/domonique-ncino","html_url":"https://github.com/domonique-ncino","followers_url":"https://api.github.com/users/domonique-ncino/followers","following_url":"https://api.github.com/users/domonique-ncino/following{/other_user}","gists_url":"https://api.github.com/users/domonique-ncino/gists{/gist_id}","starred_url":"https://api.github.com/users/domonique-ncino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domonique-ncino/subscriptions","organizations_url":"https://api.github.com/users/domonique-ncino/orgs","repos_url":"https://api.github.com/users/domonique-ncino/repos","events_url":"https://api.github.com/users/domonique-ncino/events{/privacy}","received_events_url":"https://api.github.com/users/domonique-ncino/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T18:18:09Z","updated_at":"2018-12-18T18:18:09Z","author_association":"NONE","body":"Can I help in anyway to get this pushed faster? I need this functionality badly."}}
{"actor":{"display_login":"domonique-ncino"}}