From 391bd4a54169d50ce894657daacd2d4c83f5dc7e Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 1 Oct 2014 22:00:36 -0400 Subject: [PATCH] make identifier more unique Fixes an issue where if two different file types had the same filename only the newest would be kept. admin-12345678.css <-- older would be deleted admin-12345678.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 521dd6a..0661240 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ function plugin(keepQuantity) { return through.obj(function (file, enc, cb) { var regex = new RegExp('^(.*)-[0-9a-f]{8}(?:\\.min)?\\' + path.extname(file.path) + '$'); if (regex.test(file.path)) { - var identifier = regex.exec(file.path)[1]; + var identifier = regex.exec(file.path)[1] + path.extname(file.path); if (lists[identifier] === undefined) { lists[identifier] = []; }