forked from lobehub/lobehub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
31 lines (27 loc) · 822 Bytes
/
next.config.ts
File metadata and controls
31 lines (27 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;