{"library":"rollup-cache","title":"rollup-cache","description":"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.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-cache"],"cli":null},"imports":["import { cacheConfig } from 'rollup-cache'","import { Cache } from 'rollup-cache'","import type { RollupCachePluginOptions } from 'rollup-cache'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { cacheConfig, Cache } from 'rollup-cache';\n\nconst cache = new Cache();\n\nconst rollupConfig = {\n  input: 'src/index.js',\n  output: { file: 'dist/bundle.js', format: 'esm' },\n  plugins: [\n    {\n      name: 'my-plugin',\n      resolveId(id) {\n        if (id === 'virtual-module') {\n          return '\\0virtual';\n        }\n        return null;\n      },\n      load(id) {\n        if (id === '\\0virtual') {\n          const cached = cache.get(id);\n          if (cached) return cached;\n          const code = 'export default 42;';\n          cache.set(id, code);\n          return code;\n        }\n        return null;\n      }\n    },\n    cacheConfig({ cache })\n  ]\n};\n\nexport default rollupConfig;","lang":"typescript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}