{"action":"created","issue":{"url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016/issues/13","repository_url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016","labels_url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016/issues/13/comments","events_url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016/issues/13/events","html_url":"https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/pull/13","id":130799149,"number":13,"title":"add rollup-plugin-babel-browserify","user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-02T20:00:35Z","updated_at":"2016-02-03T00:02:09Z","closed_at":"2016-02-03T00:02:09Z","pull_request":{"url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016/pulls/13","html_url":"https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/pull/13","diff_url":"https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/pull/13.diff","patch_url":"https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/pull/13.patch"},"body":"Adds a new demo: `rollup-plugin-babel-browserify`, using Rollup+Babel as an input to Browserify, as well as the super-helpful kinda-obscure [uglifyify](https://github.com/hughsk/uglifyify) transform, which cuts down enormously on the bundle size as opposed to standard Browserify.\r\n\r\nUsing this toolchain, the bundle size is cut down to **3608**, which I believe is the smallest one yet in your sample. `uglifyify` is the big hero here; without it, we'd get 4343.\r\n\r\nLove the demo, by the way! But I think one of the big takeaways is that it pays to really know your toolchain, as well as all the little tips and tricks to squeeze out bytes. :)"},"comment":{"url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016/issues/comments/178896825","html_url":"https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/pull/13#issuecomment-178896825","issue_url":"https://api.github.com/repos/samccone/The-cost-of-transpiling-es2015-in-2016/issues/13","id":178896825,"user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T00:02:09Z","updated_at":"2016-02-03T00:02:09Z","body":"@keithamus I was wondering the same thing myself! Did some digging, and looks like the issue is actually that uglify in this case isn't using `--mangle`, whereas `uglifyify` [does both `--compress` and `--mangle` by default](https://github.com/hughsk/uglifyify/blob/7134eae06a41f9dcfd3cbc4c15739af91d81781f/index.js#L50-L51).\r\n\r\nSo actually the issue is not Browserify at all; it's uglify. Doing a simple:\r\n\r\n```\r\nrollup -c | uglifyjs --compress --mangle - > ../src/dist/bundle.js\r\n```\r\n\r\nI actually get 3407 bytes, which is even smaller than before. I believe @rich-harris raised a similar point here (https://github.com/samccone/The-cost-of-transpiling-es2015-in-2016/pull/17), so I'll just close this and open an issue to add `--mangle` to the normal rollup build."}}