{"action":"created","issue":{"url":"https://api.github.com/repos/jspm/jspm-cli/issues/1631","repository_url":"https://api.github.com/repos/jspm/jspm-cli","labels_url":"https://api.github.com/repos/jspm/jspm-cli/issues/1631/labels{/name}","comments_url":"https://api.github.com/repos/jspm/jspm-cli/issues/1631/comments","events_url":"https://api.github.com/repos/jspm/jspm-cli/issues/1631/events","html_url":"https://github.com/jspm/jspm-cli/issues/1631","id":142093114,"number":1631,"title":"Static exclusion of unused exports (tree shaking)","user":{"login":"nlwillia","id":803755,"avatar_url":"https://avatars.githubusercontent.com/u/803755?v=3","gravatar_id":"","url":"https://api.github.com/users/nlwillia","html_url":"https://github.com/nlwillia","followers_url":"https://api.github.com/users/nlwillia/followers","following_url":"https://api.github.com/users/nlwillia/following{/other_user}","gists_url":"https://api.github.com/users/nlwillia/gists{/gist_id}","starred_url":"https://api.github.com/users/nlwillia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlwillia/subscriptions","organizations_url":"https://api.github.com/users/nlwillia/orgs","repos_url":"https://api.github.com/users/nlwillia/repos","events_url":"https://api.github.com/users/nlwillia/events{/privacy}","received_events_url":"https://api.github.com/users/nlwillia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-19T19:14:00Z","updated_at":"2016-04-01T17:24:51Z","closed_at":null,"body":"I'm interested in using the [lodash-es](https://github.com/lodash/lodash/issues/1473) build of `lodash` which is structured so that you can selectively pluck out just the functions that you need.  This is important for a library like lodash since it has gotten fairly large and some of what it does is now redundant with built-in capabilities in JavaScript arrays and objects.\r\n\r\nI tried this under jspm 0.16 and 0.17, and neither seem to be currently doing anything to remove what's never used.  (In all fairness, [webpack](https://github.com/webpack/webpack/issues/1750) isn't there yet either.)\r\n```\r\njspm install npm:lodash-es\r\n```\r\n```\r\nimport { chunk } from 'lodash-es';\r\nconsole.log(chunk);\r\n```\r\nIn development, there were still hundreds of eagerly dispatched requests for every exported fragment of lodash.  In `jspm build` the resulting file did not change whether I imported by function name or the whole thing except for how the import binding was compiled for my module.\r\n\r\nAm I missing something?  Is this something rollup should have detected?  If so, and there is a build solution, then is there (equally important) a development solution as well?  Is there a road map for this sort of optimized modularity?  If the answer is \"we're not there yet\" that's ok; I'd just like to know what to expect."},"comment":{"url":"https://api.github.com/repos/jspm/jspm-cli/issues/comments/204478453","html_url":"https://github.com/jspm/jspm-cli/issues/1631#issuecomment-204478453","issue_url":"https://api.github.com/repos/jspm/jspm-cli/issues/1631","id":204478453,"user":{"login":"philer","id":4589347,"avatar_url":"https://avatars.githubusercontent.com/u/4589347?v=3","gravatar_id":"","url":"https://api.github.com/users/philer","html_url":"https://github.com/philer","followers_url":"https://api.github.com/users/philer/followers","following_url":"https://api.github.com/users/philer/following{/other_user}","gists_url":"https://api.github.com/users/philer/gists{/gist_id}","starred_url":"https://api.github.com/users/philer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philer/subscriptions","organizations_url":"https://api.github.com/users/philer/orgs","repos_url":"https://api.github.com/users/philer/repos","events_url":"https://api.github.com/users/philer/events{/privacy}","received_events_url":"https://api.github.com/users/philer/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T17:24:51Z","updated_at":"2016-04-01T17:24:51Z","body":"Does the production bundle use tree shaking? All the posts in the thread seem to refer to the case where modules are loaded via individual requests, which is obviously not the way you'd want things to work in production. The whole point of rollup's tree-shaking is to create a minimal single-file bundle by analysing static import/export. This should be possible for JSPM's `--inject` or `bundle-sfx`."}}