Skip to content

Commit 3f36a3c

Browse files
committed
build(broccoli): traceur plugin should react only to .js/.es6/.cjs file removal
1 parent 8c15cce commit 3f36a3c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/broccoli/traceur/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ class DiffingTraceurCompiler implements DiffingBroccoliPlugin {
4444
});
4545

4646
treeDiff.removedPaths.forEach((removedFilePath) => {
47-
var destFilepath = removedFilePath.replace(/\.\w+$/, this.options.destExtension);
48-
var absoluteOuputFilePath = path.join(this.cachePath, destFilepath);
49-
fs.unlinkSync(absoluteOuputFilePath);
47+
var extension = path.extname(removedFilePath).toLowerCase();
48+
if (extension === '.js' || extension === '.es6' || extension === '.cjs') {
49+
var destFilepath = removedFilePath.replace(/\.\w+$/, this.options.destExtension);
50+
var absoluteOuputFilePath = path.join(this.cachePath, destFilepath);
51+
fs.unlinkSync(absoluteOuputFilePath);
52+
}
5053
});
5154
}
5255
}

0 commit comments

Comments
 (0)