{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs-templates/webpack/issues/1443","repository_url":"https://api.github.com/repos/vuejs-templates/webpack","labels_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/1443/labels{/name}","comments_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/1443/comments","events_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/1443/events","html_url":"https://github.com/vuejs-templates/webpack/issues/1443","id":360253691,"node_id":"MDU6SXNzdWUzNjAyNTM2OTE=","number":1443,"title":"the vendor file changed hash when I add echart to children chunk","user":{"login":"InvincibleJun","id":24961607,"node_id":"MDQ6VXNlcjI0OTYxNjA3","avatar_url":"https://avatars1.githubusercontent.com/u/24961607?v=4","gravatar_id":"","url":"https://api.github.com/users/InvincibleJun","html_url":"https://github.com/InvincibleJun","followers_url":"https://api.github.com/users/InvincibleJun/followers","following_url":"https://api.github.com/users/InvincibleJun/following{/other_user}","gists_url":"https://api.github.com/users/InvincibleJun/gists{/gist_id}","starred_url":"https://api.github.com/users/InvincibleJun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InvincibleJun/subscriptions","organizations_url":"https://api.github.com/users/InvincibleJun/orgs","repos_url":"https://api.github.com/users/InvincibleJun/repos","events_url":"https://api.github.com/users/InvincibleJun/events{/privacy}","received_events_url":"https://api.github.com/users/InvincibleJun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-14T10:45:12Z","updated_at":"2018-09-14T14:04:17Z","closed_at":null,"author_association":"NONE","body":"### Version\r\n2.9.3\r\n\r\n### Reproduction link\r\n[https://github.com/InvincibleJun/demo](https://github.com/InvincibleJun/demo)\r\n\r\n\r\n\r\n### Node and OS info\r\nNode 8.9.1 / npm 5.5.1 / Windows 10\r\n\r\n### Steps to reproduce\r\nfor example, I have four pages which use `() => import and use echarts. when all pages use echarts and I packed, it will make a extra chunk file. Then I only use echarts in two pages and I packed, the vendor.[hash].js is different as old file. it ‘s so terrible.\r\n\r\nCommonsChunkPlugin options as follows or see the demo\r\n```\r\n    new webpack.optimize.CommonsChunkPlugin({\r\n      name: 'vendor',\r\n      minChunks (module) {\r\n        // any required modules inside node_modules are extracted to vendor\r\n        return (\r\n          module.resource &&\r\n          /\\.js$/.test(module.resource) &&\r\n          module.resource.indexOf(\r\n            path.join(__dirname, '../node_modules')\r\n          ) === 0\r\n        )\r\n      }\r\n    }),\r\n    // extract webpack runtime and module manifest to its own file in order to\r\n    // prevent vendor hash from being updated whenever app bundle is updated\r\n    new webpack.optimize.CommonsChunkPlugin({\r\n      name: 'manifest',\r\n      minChunks: Infinity\r\n    }),\r\n    // This instance extracts shared chunks from code splitted chunks and bundles them\r\n    // in a separate chunk, similar to the vendor chunk\r\n    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk\r\n    new webpack.optimize.CommonsChunkPlugin({\r\n      name: 'app',\r\n      async: 'vendor-async',\r\n      children: true,\r\n      minChunks: 3\r\n    })\r\n```\r\n\r\n### What is expected?\r\nthe vendor hash not changed\r\n\r\n### What is actually happening?\r\nthe hash changed\r\n\r\n<!-- generated by vue-issues. DO NOT REMOVE -->"},"comment":{"url":"https://api.github.com/repos/vuejs-templates/webpack/issues/comments/421368788","html_url":"https://github.com/vuejs-templates/webpack/issues/1443#issuecomment-421368788","issue_url":"https://api.github.com/repos/vuejs-templates/webpack/issues/1443","id":421368788,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTM2ODc4OA==","user":{"login":"heinzdmx","id":5882429,"node_id":"MDQ6VXNlcjU4ODI0Mjk=","avatar_url":"https://avatars1.githubusercontent.com/u/5882429?v=4","gravatar_id":"","url":"https://api.github.com/users/heinzdmx","html_url":"https://github.com/heinzdmx","followers_url":"https://api.github.com/users/heinzdmx/followers","following_url":"https://api.github.com/users/heinzdmx/following{/other_user}","gists_url":"https://api.github.com/users/heinzdmx/gists{/gist_id}","starred_url":"https://api.github.com/users/heinzdmx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heinzdmx/subscriptions","organizations_url":"https://api.github.com/users/heinzdmx/orgs","repos_url":"https://api.github.com/users/heinzdmx/repos","events_url":"https://api.github.com/users/heinzdmx/events{/privacy}","received_events_url":"https://api.github.com/users/heinzdmx/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T14:04:17Z","updated_at":"2018-09-14T14:04:17Z","author_association":"NONE","body":"I don't think this issue tracker is meant to be used as a support option. But itsn't it because of minChunks: 3 in CommonsChunkPlugin. It essentially will only placed it in a seperate chunk if 3 chunks uses it. If only 2 it will not do that. If you setr minChunks to 2 that would probably do it for you. But that could have other consequences. "}}
{"actor":{"display_login":"heinzdmx"}}