diff --git a/lib/cachebust.js b/lib/cachebust.js index b818ec7..2e2b175 100644 --- a/lib/cachebust.js +++ b/lib/cachebust.js @@ -60,7 +60,8 @@ exports.busted = function(fileContents, options) { var originalAttrValue = loadAttribute(elements[i]); // Test for http(s) and // and don't cache bust if (assumed) served from CDN - if (!protocolRegEx.test(originalAttrValue)) { + // Test for file exist in local filesytem + if (!protocolRegEx.test(originalAttrValue) && fs.existsSync(options.basePath + originalAttrValue.split("?")[0])) { fileContents = self[options.type](fileContents, originalAttrValue, options); } }