PabloRosales JavaScript Developer

Rollup: Introduction

This tutorial is divided in 3 chapters, plus a resource list and Rollup CheatSheet

We will learn how to setup and use Rollup to create our first JavaScript bundles.

So what is a bundle?

If you want to know what a bundler is, check out the CheatSheet for Bundlers.

The future, now

Rollup uses ES6 modules, the standard for JavaScript now. If it is a standard, why do we need Rollup? Good question, main reason is that ES6 modules are not supported everywhere yet, this tool allows to use it now.

Why and when to use Rollup?

Some time ago the idea used to be this one:

Use Webpack for apps, and Rollup for libraries

But time has passed since then and Rollup has gotten a lot of plugins and improvements. You can use it NOW for JavaScript libraries and also for most applications that could use a bundler..

So, why use Rollup? If you want to use modern features of JavaScript, CSS, etc and create automatically bundles of your code plus optimizations on those, give Rollup a try, I will cover other bundlers like Webpack and Parcel in other tutorials so you can compare. Only thing that is experimental in Rollup is code-splitting, so have that in mind.

Enough talk, lets get some action going.

Made with by PR