Broccoli Caching Writer
Drop-in-replacement for
broccoli-writer adding a thin
caching layer based on the computed hash of the input directory trees. If any
file in an input node has changed, the build
method will be called,
otherwise (if input is the same) the results of the last build
call will be
used instead.
Example
var Plugin = require('broccoli-caching-writer');
MyPlugin.prototype = Object.create(Plugin.prototype);
MyPlugin.prototype.constructor = MyPlugin;
function MyPlugin(inputNodes, options) {
options = options || {};
Plugin.call(this, inputNodes, {
annotation: options.annotation
});
}
MyPlugin.prototype.build = function() {
};
Documentation
new CachingWriter(inputNodes, options)
Call this base class constructor from your subclass constructor.
plugin.listFiles
list files matched, helpful as it allows us avoid a second glob, lexicographically sorted by relativePath.
plugin.listEntries
list entries (stat objects) of files matched, helpful when further FS information is required on rebuild, lexicographically sorted by relativePath.
ZOMG!!! TESTS?!?!!?
I know, right?
Running the tests:
npm install
npm test
License
This project is distributed under the MIT license.