liveBook · Manning

Rollup

As explained in Web Components in Action

Rollup is a JavaScript module bundler that compiles ES modules into optimized output bundles.

Rollup is a JavaScript module bundler used in a build process to combine ES modules into deployable bundles. It favors a simple setup over the configurability of tools such as Webpack, making it useful for quickly building components. section 12.0 section 12.4

A practical Rollup workflow includes:

  • Install Rollup as a development dependency with npm, keeping the bundler out of the component code shipped to users. section 12.4

Build a slider bundle

Install Rollup with `npm install --save-dev rollup`, then run `npm run build` after defining a script that reads `src/slider.js`, writes `slider.js`, emits UMD output named `slider`, and generates a source map.

How Web Components in Action covers it

How deep it goes
Demonstrates installation, entry files, output formats, source maps, and npm scripts without detailing bundler internals.
Examples
Uses slider, coordinate-picker, and color-picker component builds with npm scripts and UMD output.
What it assumes
Assumes familiarity with JavaScript modules, npm, package.json, and component source-file organization.
What you can do after
Operate/configure Rollup through npm to produce component bundles and source maps.
How it connects
Connects module bundling with npm, package.json, Webpack, Parcel.js, UMD, and source maps.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Components in Action. The section links point to the parts of the book it draws on.