{"id":41910,"library":"rollup-redis-cache","title":"rollup-cache","description":"A Rollup plugin that accelerates builds by caching plugin transformations (e.g., @rollup/plugin-commonjs, @rollup/plugin-node-resolve, @rollup/plugin-babel) and prebuilding npm dependencies into separate bundles. Current stable version is 1.3.0, with irregular releases. Unlike Rollup's built-in in-memory cache, this persists to disk, speeding up initial builds and non-watch builds. Supports TypeScript types, ESM only, and requires a Redis backend.","status":"active","version":"1.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/umairnadeem/rollup-redis-cache","tags":["javascript","typescript"],"install":[{"cmd":"npm install rollup-redis-cache","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-redis-cache","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-redis-cache","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Redis client for caching","package":"ioredis","optional":false},{"reason":"Peer dependency; plugin requires Rollup >=2.0.0","package":"rollup","optional":false}],"imports":[{"note":"ESM-only; CJS require will throw because package type is module.","wrong":"const { cacheBuild } = require('rollup-cache')","symbol":"cacheBuild","correct":"import { cacheBuild } from 'rollup-cache'"},{"note":"CacheConfig is exported as a type only.","wrong":"import { CacheConfig } from 'rollup-cache'","symbol":"type CacheConfig","correct":"import type { CacheConfig } from 'rollup-cache'"},{"note":"Default export is the same as named export cacheBuild; but using default is not recommended as it may be deprecated.","wrong":"","symbol":"default","correct":"import rollupCache from 'rollup-cache'"}],"quickstart":{"code":"// rollup.config.js\nimport { cacheBuild } from 'rollup-cache';\nimport resolve from '@rollup/plugin-node-resolve';\n\nexport default cacheBuild(\n  {\n    name: 'my-app',\n    enabled: process.env.NODE_ENV !== 'production',\n    dependencies: ['rollup.config.js'],\n    prebuild: ['lodash'],\n  },\n  {\n    input: 'src/main.js',\n    output: {\n      dir: 'dist',\n      format: 'es',\n    },\n    plugins: [resolve()],\n  }\n);\n","lang":"typescript","description":"Configures Rollup with disk caching, plugin caching enabled automatically, and prebuilding lodash into a separate bundle."},"warnings":[{"fix":"Upgrade Rollup to version 2.0.0 or higher.","message":"Requires Rollup >=2.0.0","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Replace 'import rollupCache from \"rollup-cache\"' with 'import { cacheBuild } from \"rollup-cache\"'.","message":"Default export may be removed in future versions; use named export cacheBuild.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"If you need caching for other plugins, open an issue or implement custom caching via wrapper.","message":"Plugin caching only works with official plugins by default (commonjs, node-resolve, babel). Custom plugins are not cached.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set output.format to 'es' in your rollup config and use <script type=\"module\"> in HTML.","message":"Prebuilding requires output format 'es' and script type module in HTML.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install and run Redis, or use the Redis_HOST and Redis_PORT environment variables to point to an existing instance.","message":"Redis is required but not documented in the main README; failing to configure Redis will cause build to hang.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Always set 'enabled' in cacheConfig to avoid unintended cache disable in production.","message":"The option 'enabled' defaults to false in production (NODE_ENV=production). Do not rely on default; set explicitly.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.3.0':29 'acceler':8 'backend':65 'build':9,50,55 'built':37 'built-in':36 'bundl':24 'cach':3,11,42 'current':25 'depend':21 'disk':46 'e.g':14 'esm':59 'in-memori':39 'initi':49 'irregular':31 'javascript':66 'memori':41 'non':53 'non-watch':52 'npm':20 'persist':44 'plugin':6,12 'prebuild':19 'redi':64 'releas':32 'requir':62 'rollup':2,5,34 'rollup-cach':1 'rollup/plugin-babel':17 'rollup/plugin-commonjs':15 'rollup/plugin-node-resolve':16 'separ':23 'speed':47 'stabl':26 'support':56 'transform':13 'type':58 'typescript':57,67 'unlik':33 'version':27 'watch':54","created_at":"2026-06-04T18:54:42.182998+00:00","updated_at":"2026-06-04T18:54:42.182998+00:00","problems":[{"fix":"Use import syntax or set \"type\": \"module\" in package.json.","cause":"Package is ESM-only, but required with require().","error":"Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /path/to/node_modules/rollup-cache/index.js"},{"fix":"Replace default import with: import { cacheBuild } from 'rollup-cache'","cause":"Default export is not a function; use named export cacheBuild.","error":"TypeError: rollupCache is not a function"},{"fix":"Install and start Redis server, or set environment variables Redis_HOST and Redis_PORT.","cause":"Redis is not installed or not accessible.","error":"Error: Redis connection refused. Ensure Redis is running."},{"fix":"Set output.format to 'es' in your rollup config.","cause":"Prebuild feature only works with ES module output.","error":"[!] Error: Prebuild requires output.format to be 'es'. Current format is 'cjs'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/umairnadeem/rollup-redis-cache#readme","github":"https://github.com/umairnadeem/rollup-redis-cache","docs":null,"changelog":null,"pypi":null,"npm":"rollup-redis-cache","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}