Skip to content

Commit a501bcd

Browse files
committed
fix: Handle aggregation filename collision.
1 parent 3bbeb3a commit a501bcd

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/@css-blocks/broccoli/src/Aggregate.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ export class CSSBlocksAggregate extends BroccoliPlugin {
5050
// Test if anything has changed since last time. If not, skip trying to update tree.
5151
let newFsTree = FSTree.fromEntries(walkSync.entries(input));
5252
let diff = this.previous.calculatePatch(newFsTree);
53-
if (diff.length) {
54-
this.previous = newFsTree;
55-
FSTree.applyPatch(input, output, diff);
56-
}
5753

5854
// Auto-discover common preprocessor extensions.
5955
if (!this._out) {
@@ -71,6 +67,19 @@ export class CSSBlocksAggregate extends BroccoliPlugin {
7167
this._out = path.format(out);
7268
}
7369

70+
if (diff.length) {
71+
this.previous = newFsTree;
72+
let newDiff = new Array<FSTree.Operation>();
73+
for (let change of diff) {
74+
let file = change[1];
75+
if (file === this._out) {
76+
continue;
77+
}
78+
newDiff.push(change);
79+
}
80+
FSTree.applyPatch(input, output, newDiff);
81+
}
82+
7483
let outHasChanged = !!diff.find((o) => o[1] === this._out);
7584
if (outHasChanged || this.previousCSS !== css) {
7685
let prev = path.join(input, this._out);

0 commit comments

Comments
 (0)