From 3f36a3c1198ee143d2186fe4d112c4e10199c0f2 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 5 May 2015 16:13:07 -0700 Subject: [PATCH] build(broccoli): traceur plugin should react only to .js/.es6/.cjs file removal --- tools/broccoli/traceur/index.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/broccoli/traceur/index.ts b/tools/broccoli/traceur/index.ts index 4d95f58fd0..76a598cac8 100644 --- a/tools/broccoli/traceur/index.ts +++ b/tools/broccoli/traceur/index.ts @@ -44,9 +44,12 @@ class DiffingTraceurCompiler implements DiffingBroccoliPlugin { }); treeDiff.removedPaths.forEach((removedFilePath) => { - var destFilepath = removedFilePath.replace(/\.\w+$/, this.options.destExtension); - var absoluteOuputFilePath = path.join(this.cachePath, destFilepath); - fs.unlinkSync(absoluteOuputFilePath); + 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); + } }); } }