Skip to content

Commit

Permalink
feat: allow exclude per folder
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Mar 2, 2023
1 parent 8b40329 commit 468b251
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
5 changes: 5 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 468b251

Please sign in to comment.