Files

27 lines
841 B
TypeScript
Raw Permalink Normal View History

2025-12-25 18:04:53 +08:00
import { defineConfig } from './src/libs/next/config/define-config';
2023-07-11 19:46:11 +08:00
2026-01-24 18:04:45 +08:00
const isVercel = !!process.env.VERCEL_ENV;
const vercelConfig = {
// Vercel serverless optimization: exclude musl binaries from all routes
2026-01-24 18:04:45 +08:00
// 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/**',
],
2026-01-01 19:18:38 +08:00
},
};
const nextConfig = defineConfig({
...(isVercel ? vercelConfig : {}),
2026-01-01 19:18:38 +08:00
});
2023-07-23 15:54:02 +08:00
2025-12-25 18:04:53 +08:00
export default nextConfig;