Caching utilities for Rollup build plugins. Current version 2.0.0 requires Rollup v3 (breaking change from v1.x which targeted Rollup v2). Provides cacheConfig() and Cache class to persist and reuse expensive computation results across builds, improving incremental build performance. Key differentiator: designed specifically for Rollup plugin ecosystem with cache key generation and invalidation similar to Rollup's own caching. Releases are infrequent; maintenance seems low. Ships TypeScript types. ESM and CommonJS builds available.
npm install rollup-cacheVerified import paths — ran on the pinned version, not inferred.
Shows how to create a Cache instance, wrap Rollup config with cacheConfig() to persist cache across builds, and use the cache inside a custom plugin's load hook.
Use rollup-cache v1.x with Rollup v2, or upgrade Rollup to v3.
Use ESM import to avoid type resolution issues, or pin exact version.
Upgrade to v1.1.0 or later, or use internal cache manually.
Ensure rollup-cache is installed: npm install rollup-cache. Use import from 'rollup-cache' not a subpath.
Upgrade Rollup to v3 or downgrade rollup-cache to v1.x: npm install rollup-cache@1
Upgrade to rollup-cache v1.1.0 or later: npm install rollup-cache@latest