Rollup Boilerplate

raw JSON →
1.1.5 verified Mon Apr 27 auth: no javascript maintenance

Rollup boilerplate is a project generator for UMD+ESM JavaScript libraries. Version 1.1.5 provides a CLI tool to scaffold a modern library project with Rollup, Babel, and testing setup. It supports both CommonJS (UMD) and ES module (MJS) outputs, making it suitable for creating universal libraries. Release cadence is low; last update was in 2021. Differentiators: automatic dependency installation, customized project structure, and built-in configuration for Rollup and Babel in a single command.

error Error: Cannot find module 'commander'
cause Missing dependency when running the CLI without global install.
fix
Run 'npm install -g rollup-boilerplate'.
error ReferenceError: regeneratorRuntime is not defined
cause Generated code uses async/await but @babel/runtime is not properly configured.
fix
Add 'transform-runtime' plugin to Babel config or install @babel/runtime.
error SyntaxError: Unexpected token 'export'
cause Trying to run ESM output in an older Node.js version that does not support ES modules.
fix
Use the UMD bundle (dist/umd/) or upgrade to Node >=13.2.
deprecated Package has not been updated since 2021; may not work with latest Node.js versions (e.g., Node>=16).
fix Consider alternatives like create-rollup-app or manually set up Rollup.
gotcha Global install required for CLI command; local install may not expose 'create-library' in PATH.
fix Install with -g flag, or use npx rollup-boilerplate.
gotcha The generated project uses Babel v7; ensure your Node.js version is compatible.
fix If using latest Node, upgrade Babel presets if needed.
npm install rollup-boilerplate
yarn add rollup-boilerplate
pnpm add rollup-boilerplate

Install the CLI globally, create a folder, run 'create-library', answer prompts, then install dependencies and build.

# Install globally
npm install -g rollup-boilerplate

# Create a new library
mkdir myLibrary && cd myLibrary
create-library
# Follow prompts: name, version, description, author, etc.
# Then run:
npm install
npm run build # builds UMD and ESM bundles under dist/
npm test # runs Jest tests