mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 01:15:58 +00:00
fix(nitro): detect routes and middleware starting with dots (#2771)
This commit is contained in:
parent
23b230b34b
commit
8588f749ad
@ -47,8 +47,8 @@ export function scanMiddleware (serverDir: string, onChange?: (results: ServerMi
|
|||||||
const apiDir = resolve(serverDir, 'api')
|
const apiDir = resolve(serverDir, 'api')
|
||||||
|
|
||||||
const scan = async () => {
|
const scan = async () => {
|
||||||
const globalFiles = await globby(pattern, { cwd: globalDir })
|
const globalFiles = await globby(pattern, { cwd: globalDir, dot: true })
|
||||||
const apiFiles = await globby(pattern, { cwd: apiDir })
|
const apiFiles = await globby(pattern, { cwd: apiDir, dot: true })
|
||||||
return [
|
return [
|
||||||
...filesToMiddleware(globalFiles, globalDir, '/', { route: '/' }),
|
...filesToMiddleware(globalFiles, globalDir, '/', { route: '/' }),
|
||||||
...filesToMiddleware(apiFiles, apiDir, '/api', { lazy: true })
|
...filesToMiddleware(apiFiles, apiDir, '/api', { lazy: true })
|
||||||
|
Loading…
Reference in New Issue
Block a user