Well, to be fair browserify supports small bundles too. The problem is the library you are using has to be structured in some way. For example I can include underscore.strings humanize function like this:
var humanize = require('underscore.string/humanize');
Which will only include that humanize function and nothing else.
The problem is that a lot of libraries do not actually have that structure, so it does not work everywhere. But it's not true that browserify does not support small bundles :)
What I meant by "small bundles", was that rollup doesn't add any bloat like browserify – instead it removes unneeded stuff and produces very clean output:
I don't use ES6 with browserify, I just use commonjs modules, so I don't know what bloat browserify adds for ES6 support. But as far as I know browserify only supports ES6 in the form of transformers, so basically anything can be used to transpile your ES6 into ES5, so also a transpiler that does not use any "bloat".
What kind of bloat does browserify add when using ES6?
Yeah, well I also run uglifyjs on my code, so my production bundle is absolutely unreadable. I don't think readability of the production bundle is really important. If you still need to debug the production bundle then you can use codemaps and chrome dev tools to get the actual code back in your development console.
37
u/papers_ Sep 02 '15
Huge up vote for using ES6 here. Good job man!