Skip to content

Commit 64ff29b

Browse files
committed
[WIP] Replace broccoli-filter with broccoli-persistent-filter
1 parent 3386577 commit 64ff29b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

lib/asset-rev.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function AssetRev(inputTree, options) {
2323
this.prepend = options.prepend || defaults.prepend;
2424
this.ignore = options.ignore;
2525
this.description = options.description;
26+
this.persist = options.persist;
2627

2728
var fingerprintTree = Fingerprint(inputTree, this);
2829

lib/fingerprint.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var fs = require('fs');
22
var path = require('path');
33
var crypto = require('crypto');
4-
var Filter = require('broccoli-filter');
4+
var Filter = require('broccoli-persistent-filter');
55
var Promise = require('rsvp').Promise;
66
// JSON.stringify is not stable
77
var stringify = require('json-stable-stringify');
@@ -24,10 +24,15 @@ function Fingerprint(inputNode, options) {
2424

2525
options = options || {};
2626

27+
if (typeof options.persist === 'undefined') {
28+
options.persist = true;
29+
}
30+
2731
Filter.call(this, inputNode, {
2832
extensions: options.extensions || [],
2933
// We should drop support for `description` in the next major release
30-
annotation: options.description || options.annotation
34+
annotation: options.description || options.annotation,
35+
persist: options.persist
3136
})
3237

3338
this.assetMap = options.assetMap || {};
@@ -70,6 +75,10 @@ Fingerprint.prototype.canProcessFile = function (relativePath) {
7075
return Filter.prototype.getDestFilePath.apply(this, arguments) != null;
7176
};
7277

78+
Fingerprint.prototype.baseDir = function () {
79+
return path.resolve(__dirname, '..');
80+
};
81+
7382
Fingerprint.prototype.processFile = function (srcDir, destDir, relativePath) {
7483
var file = fs.readFileSync(srcDir + '/' + relativePath);
7584
var self = this;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"homepage": "https://github.com/rickharrison/broccoli-asset-rev",
3333
"dependencies": {
3434
"broccoli-asset-rewrite": "^1.0.9",
35-
"broccoli-filter": "^1.2.2",
35+
"broccoli-persistent-filter": "^1.2.0",
3636
"json-stable-stringify": "^1.0.0",
3737
"matcher-collection": "^1.0.1",
3838
"rsvp": "~3.0.6"

0 commit comments

Comments
 (0)