When comparing Browserify vs rollup.js, the Slant community recommends Browserify for most people. In the question“What are the best RequireJS alternatives?” Browserify is ranked 1st while rollup.js is ranked 3rd. The most important reason people chose Browserify is:
Using browserify opens you up to npm, that has over 80k modules of which a great amount work both client-side and server-side. And the list is growing rapidly.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Tap into npm's huge module ecosystem
Using browserify opens you up to npm, that has over 80k modules of which a great amount work both client-side and server-side. And the list is growing rapidly.
Pro Simple to use dependency management
To require a file, just use the require() function.
var foo = require('./foo.js');
These files may have dependencies of their own. Browserify will build a dependency graph and bundle it into a single file that you just have to put in a script tag.
<html>
<body>
<script src="bundle.js"></script>
</body>
</html>
Pro Share the same modules client-side and server-side
Because browserify allows you to use the same require() function as node.js, you can easily share modules between the client-side and server-side.
Pro Provides browser-friendly shims of Node modules
Browserify provides browser-friendly shims of Node modules, that allow for things like Node event systems, path parsing, URL parsing.
Pro deAMDify & debowerify allow using modules written for other systems
Browserify includes transforms such as deAMDify, that allow you to use modules written in the AMD module format, and debowerify, that allows you to use modules intended to be managed by Bower package manager.
Pro CJS module format
Pro Friendly plugin interface
Writing plugins is relatively easy and straight forward as each file, you can run a function that gives a file name and path, based on that you can decide if you want to do something like parse, transform, modify etc the file or skip it.
Pro Provides tree shaking
Tree shaking can significantly reduce the size of your bundle by getting rid of unused code from the libraries you are using.
Pro Reactjs droped Webpack and is now using rollup
Pro Outputs almost any module format
AMD, CommonJS, ES2015, Globals and UMD are all supported.
Pro Easy to configure
Rollup is very easy ton configure through a JSON file.
Pro Supports plugins
Rollup can be expanded just like webpack and browserify through the use of plugins. Plugins can do things such as transpilation (e.g. with Babel), import data from non JS places (like JSON files), etc.
Cons
Con Requires NodeJS environment just to get in the door
Browserify does nothing client-side. It's only a server-side builder. If you want to load files from other domains, look at RequireJS. If you want to break your code up into multiple modules, look at RequireJS or Webpack.
Con Requires a lot of magic for setup
Digging for high amount of modules
Con Relatively new
Rollup is still relatively new so it may be a bit harder to find information on how to do some things with it. In addition, that means that plugins can be a little scarce and it may be subject to minor changes as it matures.