rollup-config-whim
raw JSON → 3.0.0 verified Mon Apr 27 auth: no javascript
A protean Rollup configuration generator that adapts to personal preferences for module and web builds. Current stable version is 3.0.0. Provides two main helpers: configureModule() for ES module output and configureWeb() for browser bundles. The package requires Rollup as a peer dependency and is intended for developers who want a zero-config Rollup setup with opinionated defaults. It does not include TypeScript or Babel by default; users must add those plugins separately. Release cadence is irregular, driven by the author's whims.
Common errors
error Cannot find module 'rollup-config-whim' ↓
cause Package not installed or incorrect npm install command.
fix
Run: npm install --save-dev rollup rollup-config-whim
error 'configureModule' is not exported from 'rollup-config-whim' ↓
cause Using import that expects default export when named export is required.
fix
Use import { configureModule } from 'rollup-config-whim'
error TypeError: Cannot read property 'input' of undefined ↓
cause configureModule() returned undefined because of missing Rollup peer dependency.
fix
Install rollup: npm install --save-dev rollup
Warnings
gotcha Package expects Rollup as peer dependency; missing Rollup causes build failures. ↓
fix Install rollup alongside rollup-config-whim: npm install --save-dev rollup rollup-config-whim
gotcha configureWeb() returns an object without overriding output or plugins; those must be spread and overridden manually. ↓
fix Use spread operator: { ...configureWeb(), output: {...} }
gotcha No built-in support for TypeScript, Babel, or other transpilers; user must add plugins manually. ↓
fix Install and configure @rollup/plugin-typescript or @rollup/plugin-babel separately.
Install
npm install rollup-config-whim yarn add rollup-config-whim pnpm add rollup-config-whim Imports
- configureModule wrong
const { configureModule } = require('rollup-config-whim')correctimport { configureModule } from 'rollup-config-whim' - configureWeb wrong
import configureWeb from 'rollup-config-whim'correctimport { configureWeb } from 'rollup-config-whim' - default import wrong
import Whim from 'rollup-config-whim'correct
Quickstart
import { configureModule, configureWeb } from 'rollup-config-whim';
export default ({
...configureModule(),
input: 'src/index.js',
output: { file: 'dist/bundle.js', format: 'esm' }
});