From 92547d8547046bd27068bc0798f7b18ecacaa674 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 21 Oct 2021 01:30:42 +0800 Subject: [PATCH] fix(nitro): filter alias in `/_vfs` listing (#1296) --- packages/nitro/src/server/vfs.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/nitro/src/server/vfs.ts b/packages/nitro/src/server/vfs.ts index 3dcfc14669..f5e40f233c 100644 --- a/packages/nitro/src/server/vfs.ts +++ b/packages/nitro/src/server/vfs.ts @@ -4,10 +4,11 @@ import { NitroContext } from '..' export function handleVfs (ctx: NitroContext): Handle { return (req) => { if (req.url === '/') { - return '' + const items = Object.keys(ctx.vfs) + .filter(i => !i.startsWith('#')) + .map(key => `
  • ${key.replace(ctx._nuxt.rootDir, '')}
  • `) + .join('\n') + return `` } const param = decodeURIComponent(req.url.slice(1)) if (param in ctx.vfs) {