mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
32 lines
822 B
TypeScript
32 lines
822 B
TypeScript
import { defineConfig } from './src/libs/next/config/define-config';
|
|
|
|
const isVercel = !!process.env.VERCEL_ENV;
|
|
|
|
const nextConfig = defineConfig({
|
|
experimental: {
|
|
webpackBuildWorker: true,
|
|
webpackMemoryOptimizations: true,
|
|
},
|
|
// Vercel serverless optimization: exclude musl binaries
|
|
// Vercel uses Amazon Linux (glibc), not Alpine Linux (musl)
|
|
// This saves ~45MB (29MB canvas-musl + 16MB sharp-musl)
|
|
outputFileTracingExcludes: isVercel
|
|
? {
|
|
'*': [
|
|
'node_modules/.pnpm/@napi-rs+canvas-*-musl*',
|
|
'node_modules/.pnpm/@img+sharp-libvips-*musl*',
|
|
],
|
|
}
|
|
: undefined,
|
|
webpack: (webpackConfig, context) => {
|
|
const { dev } = context;
|
|
if (!dev) {
|
|
webpackConfig.cache = false;
|
|
}
|
|
|
|
return webpackConfig;
|
|
},
|
|
});
|
|
|
|
export default nextConfig;
|