From 8588f749ad2e2d82a328b24cd461c929b878b1a5 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 18 Jan 2022 16:37:40 +0000 Subject: [PATCH] fix(nitro): detect routes and middleware starting with dots (#2771) --- packages/nitro/src/server/middleware.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nitro/src/server/middleware.ts b/packages/nitro/src/server/middleware.ts index 62684d83f5..15472f7a71 100644 --- a/packages/nitro/src/server/middleware.ts +++ b/packages/nitro/src/server/middleware.ts @@ -47,8 +47,8 @@ export function scanMiddleware (serverDir: string, onChange?: (results: ServerMi const apiDir = resolve(serverDir, 'api') const scan = async () => { - const globalFiles = await globby(pattern, { cwd: globalDir }) - const apiFiles = await globby(pattern, { cwd: apiDir }) + const globalFiles = await globby(pattern, { cwd: globalDir, dot: true }) + const apiFiles = await globby(pattern, { cwd: apiDir, dot: true }) return [ ...filesToMiddleware(globalFiles, globalDir, '/', { route: '/' }), ...filesToMiddleware(apiFiles, apiDir, '/api', { lazy: true })