From add80cdb57bd3e9a8589de0d2566e0a3bdce118a Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Sat, 6 Dec 2025 23:50:22 +0800 Subject: [PATCH] chore: fix vercel serve static --- lib/registry.ts | 2 +- tsdown-vercel.config.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/registry.ts b/lib/registry.ts index 2e7f28c832..436276d315 100644 --- a/lib/registry.ts +++ b/lib/registry.ts @@ -258,7 +258,7 @@ if (config.debugInfo) { // Only enable tracing in debug mode app.get('/metrics', metrics); } -if (!config.isPackage) { +if (!config.isPackage && !process.env.VERCEL_ENV) { app.use( '/*', serveStatic({ diff --git a/tsdown-vercel.config.ts b/tsdown-vercel.config.ts index b137eabb3e..ce0b550403 100644 --- a/tsdown-vercel.config.ts +++ b/tsdown-vercel.config.ts @@ -8,5 +8,5 @@ export default defineConfig({ shims: true, clean: true, plugins: [artTemplatesPlugin()], - copy: ['lib/assets'], + copy: [{ from: 'lib/assets', to: 'dist/public' }], });