fix(package): no fallback serve for package mode

This commit is contained in:
Stephen Zhou
2025-11-27 03:33:44 +08:00
parent da5f5080fe
commit 411bf6e445
+9 -7
View File
@@ -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;