From 468b2518badeb7981ad5ae123c5edd2fee80ab35 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 2 Mar 2023 17:38:51 +0100 Subject: [PATCH] feat: allow exclude per folder --- src/core/context.ts | 2 +- src/options.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/context.ts b/src/core/context.ts index ba60dd812..240459d3c 100644 --- a/src/core/context.ts +++ b/src/core/context.ts @@ -79,7 +79,7 @@ export function createRoutesContext(options: ResolvedOptions) { cwd: folder.src, // TODO: do they return the symbolic link path or the original file? // followSymbolicLinks: false, - ignore: options.exclude, + ignore: folder.exclude || options.exclude, }) .then((files) => files.map((file) => resolve(folder.src, file))) .then((files) => diff --git a/src/options.ts b/src/options.ts index eabc7430a..669148c31 100644 --- a/src/options.ts +++ b/src/options.ts @@ -21,6 +21,11 @@ export interface RoutesFolderOption { */ filePatterns?: string | string[] + /** + * Allows to override the global `exclude` option for this folder. + */ + exclude?: string[] + /** * Allows to override the global `extensions` option for this folder. */