A base class for Broccoli plugins that map input files to output files with a persistent disk cache. Current stable version is 3.1.3 (released 2021). It extends the Broccoli filter concept by caching processed results across builds, enabling fast restarts. Key differentiators: built-in async/concurrency support, dependency invalidation tracking, and configurable input/output encoding. Unlike plain broccoli-filter, it persists cached results to disk to avoid reprocessing unchanged files between builds, making it suitable for large projects with slow transforms.
npm install broccoli-persistent-filterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to subclass Filter, implement processString, and use constructor options to transform .txt files to .js.
Remove any `persist` option from constructor. Caching is automatic.
Ensure your object has an `output` property: `return { output: transformedContent };`Avoid directly interacting with the cache. Rely on built-in persistent caching.
Wrap synchronous return values in `Promise.resolve()` or make `processString` async.
Upgrade Node.js to 10.x or newer.
Change to const Filter = require('broccoli-persistent-filter');Add 'output' property to the returned object: return { output: myContent };Add extensions option: 'extensions': ['js', 'ts']