Skip to content

Commit 20d2b23

Browse files
author
RooCode
committed
fix: .next/cache so large in vercel
1 parent 7748bc2 commit 20d2b23

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

next.config.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ import createNextIntlPlugin from "next-intl/plugin";
33

44
const withNextIntl = createNextIntlPlugin("./configs/i18n/request.ts");
55

6-
const nextConfig: NextConfig = {};
6+
const nextConfig: NextConfig = {
7+
output: "standalone",
8+
webpack: (
9+
config,
10+
{
11+
buildId: _buildId,
12+
dev,
13+
isServer: _isServer,
14+
defaultLoaders: _defaultLoaders,
15+
nextRuntime: _nextRuntime,
16+
webpack: _webpack
17+
}
18+
) => {
19+
if (config.cache && !dev) {
20+
config.cache = Object.freeze({ type: "memory" });
21+
}
22+
// Important: return the modified config
23+
return config;
24+
}
25+
};
726

827
export default withNextIntl(nextConfig);

0 commit comments

Comments
 (0)