From 835a89856f79b12e2792d9711ed8e446c88a93b8 Mon Sep 17 00:00:00 2001 From: Luca Sartori Date: Mon, 9 Aug 2021 11:51:55 +0200 Subject: [PATCH] Allow --exclude to match folders instead of just file names --- lib/svgo/coa.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/svgo/coa.js b/lib/svgo/coa.js index 84e88ac62..7e1feb04e 100644 --- a/lib/svgo/coa.js +++ b/lib/svgo/coa.js @@ -330,7 +330,9 @@ function getFilesDescriptions(config, dir, files, output) { .filter( (name) => regSVGFile.test(name) && - !config.exclude.some((regExclude) => regExclude.test(name)) + !config.exclude.some( + (regExclude) => regExclude.test(PATH.resolve(dir, name)) + ) ) .map((name) => ({ inputPath: path.resolve(dir, name),