mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
27 lines
840 B
TypeScript
27 lines
840 B
TypeScript
import { defineConfig } from './src/libs/next/config/define-config';
|
|
|
|
const isVercel = !!process.env.VERCEL_ENV;
|
|
|
|
const vercelConfig = {
|
|
// Vercel serverless optimization: exclude musl binaries from all routes
|
|
// Vercel uses Amazon Linux (glibc), not Alpine Linux (musl)
|
|
// This saves ~45MB (29MB canvas-musl + 16MB sharp-musl) per serverless function
|
|
outputFileTracingExcludes: {
|
|
'*': [
|
|
'node_modules/.pnpm/@napi-rs+canvas-*-musl*',
|
|
'node_modules/.pnpm/@img+sharp-libvips-*musl*',
|
|
// Exclude SPA/desktop/mobile build artifacts from serverless functions
|
|
'public/spa/**',
|
|
'dist/desktop/**',
|
|
'dist/mobile/**',
|
|
'apps/desktop/**',
|
|
'packages/database/migrations/**',
|
|
],
|
|
},
|
|
};
|
|
const nextConfig = defineConfig({
|
|
...(isVercel ? vercelConfig : {}),
|
|
});
|
|
|
|
export default nextConfig;
|