{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/1750","labels_url":"https://api.github.com/repos/webpack/webpack/issues/1750/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/1750/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/1750/events","html_url":"https://github.com/webpack/webpack/issues/1750","id":121886122,"number":1750,"title":"tree-shaking with lodash-es","user":{"login":"jdalton","id":4303,"avatar_url":"https://avatars.githubusercontent.com/u/4303?v=3","gravatar_id":"","url":"https://api.github.com/users/jdalton","html_url":"https://github.com/jdalton","followers_url":"https://api.github.com/users/jdalton/followers","following_url":"https://api.github.com/users/jdalton/following{/other_user}","gists_url":"https://api.github.com/users/jdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdalton/subscriptions","organizations_url":"https://api.github.com/users/jdalton/orgs","repos_url":"https://api.github.com/users/jdalton/repos","events_url":"https://api.github.com/users/jdalton/events{/privacy}","received_events_url":"https://api.github.com/users/jdalton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webpack/webpack/labels/enhancement","name":"enhancement","color":"DDDDDD"},{"url":"https://api.github.com/repos/webpack/webpack/labels/webpack-2","name":"webpack-2","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-12-12T22:58:33Z","updated_at":"2015-12-27T21:14:12Z","closed_at":null,"body":"See https://github.com/webpack/webpack/issues/1612#issuecomment-161018259.\r\nCurrently tree-shaking lodash-es modules is not possible with webpack 2 beta.\r\n\r\nFirst clone into `node_modules`:\r\n```bash\r\ngit clone -b es --depth=1 https://github.com/lodash/lodash.git ./node_modules/lodash-es\r\n```\r\n\r\nthen:\r\n```bash\r\nnpm i -g webpack@beta\r\n```\r\n\r\nthen:\r\n```bash\r\nnpm i babel-loader@^5 babel-core@^5\r\n```\r\nwith test.js:\r\n```js\r\nimport { chunk } from 'lodash-es';\r\nconsole.log(chunk([1,2,3,4], 2));\r\n```\r\nthen:\r\n```bash\r\nwebpack ./test.js ./bundle.js -p --display-chunks --display-modules --display-origins --module-bind js=babel-loader?blacklist[]=es6.modules\r\n```\r\nis\r\n```\r\n> gzip-size bundle.js | pretty-bytes\r\n30.41 kB\r\n```\r\n\r\nWhile the output of `import { chunk } from 'lodash-es/array/chunk'`\r\nis\r\n```\r\n> gzip-size bundle.js | pretty-bytes\r\n1.19 kB\r\n```\r\n\r\nRelated to https://github.com/rollup/rollup/issues/45"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/167441881","html_url":"https://github.com/webpack/webpack/issues/1750#issuecomment-167441881","issue_url":"https://api.github.com/repos/webpack/webpack/issues/1750","id":167441881,"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":"2015-12-27T21:14:12Z","updated_at":"2015-12-27T21:14:12Z","body":"Not babels fault. I noticed the issue, but it's a bit difficult.\n\nWe can optimize it, but this would be an unsafe optimization. The ES6 spec says that all dependencies must be loaded even if the exports are not used."}}