Member-only story

Rollup vs. Parcel vs. webpack: Which Is the Best Bundler?

The battle of the bundlers

Manisha Sharma
Better Programming
8 min readNov 25, 2019

--

Rollup vs. Parcel vs. webpack: Who wins as the best choice for a bundler?

Recently I was publishing a library to npm and I thought of experimenting with the bundler I was going to package my code in. While webpack has always been my standard choice, I decided to put it up against two other popular bundlers — Rollup and Parcel.

For those coming from a non-JavaScript background, a bundler is a tool that recursively follows all imports from the entry point of your app and bundles them up into a single file. Bundlers can also minify your files by removing unnecessary white spaces, new lines, comments, and block delimiters without affecting their functionality.

Let’s try to understand this through a simple code snippet:

var test = [];
for (var i = 0; i < 100; i++) {
test[i] = i;
}

We just created an array called test and initialised its members till 100. The minified version of this code will look somewhat like this:

for(var a=[i=0];++i<20;a[i]=i);

Fewer characters and lines. You might say the code is not readable, but who cares? You bundle your code once it’s ready, and minified code is easy to fetch and interpret for the browser.

--

--

Manisha Sharma
Manisha Sharma

Written by Manisha Sharma

Javascript Enthusiast and Senior Software Engineer at Freshworks

Responses (5)

What are your thoughts?