build(broccoli): traceur plugin should react only to .js/.es6/.cjs file removal

This commit is contained in:
Igor Minar 2015-05-05 16:13:07 -07:00
parent 8c15ccecd1
commit 3f36a3c119
1 changed files with 6 additions and 3 deletions

View File

@ -44,9 +44,12 @@ class DiffingTraceurCompiler implements DiffingBroccoliPlugin {
});
treeDiff.removedPaths.forEach((removedFilePath) => {
var extension = path.extname(removedFilePath).toLowerCase();
if (extension === '.js' || extension === '.es6' || extension === '.cjs') {
var destFilepath = removedFilePath.replace(/\.\w+$/, this.options.destExtension);
var absoluteOuputFilePath = path.join(this.cachePath, destFilepath);
fs.unlinkSync(absoluteOuputFilePath);
}
});
}
}