From 411bf6e4459380c4659831b848d2ca0a960cf1ff Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Thu, 27 Nov 2025 03:33:44 +0800 Subject: [PATCH] fix(package): no fallback serve for package mode --- lib/registry.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/registry.ts b/lib/registry.ts index 2d2450730e..26fd81997d 100644 --- a/lib/registry.ts +++ b/lib/registry.ts @@ -256,12 +256,14 @@ if (config.debugInfo) { // Only enable tracing in debug mode app.get('/metrics', metrics); } -app.use( - '/*', - serveStatic({ - root: path.join(__dirname, 'assets'), - rewriteRequestPath: (path) => (path === '/favicon.ico' ? '/favicon.png' : path), - }) -); +if (!config.isPackage) { + app.use( + '/*', + serveStatic({ + root: path.join(__dirname, 'assets'), + rewriteRequestPath: (path) => (path === '/favicon.ico' ? '/favicon.png' : path), + }) + ); +} export default app;