From 847ebf340f9292c8ad579ad9ca36b10ad827f7c7 Mon Sep 17 00:00:00 2001 From: Will O'Beirne Date: Tue, 20 Mar 2018 12:15:18 -0400 Subject: [PATCH] If no cache file is found, just exit. --- webpack_config/plugins/sortCache.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webpack_config/plugins/sortCache.js b/webpack_config/plugins/sortCache.js index be77fcd7..fcc0df25 100644 --- a/webpack_config/plugins/sortCache.js +++ b/webpack_config/plugins/sortCache.js @@ -13,10 +13,12 @@ SortCachePlugin.prototype.apply = function(compiler) { const cacheFilePaths = klawSync(buildDir, { filter: findCacheFile }); if (!cacheFilePaths.length) { - throw new Error('Could not find .cache file'); + console.warn('No cache icon cache file found for sorting.'); + return; } + if (cacheFilePaths.length > 1) { - throw new Error('More than one possible .cache file detected'); + throw new Error('More than one possible icon .cache file detected', cacheFilePaths); } const cacheFilePath = cacheFilePaths[0].path;