Skip to content

Commit e60bf54

Browse files
committed
Add memory optimization for cPanel build process
1 parent 6fa060f commit e60bf54

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

next.config.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,36 @@ const nextConfig = {
1313
basePath: "/acm",
1414
assetPrefix: "/acm/",
1515

16+
// Memory optimization for cPanel build
17+
experimental: {
18+
// Reduce memory usage during build
19+
memoryBasedWorkers: false,
20+
},
21+
22+
// Webpack optimization for memory
23+
webpack: (config, { isServer }) => {
24+
if (!isServer) {
25+
// Reduce memory usage for client-side build
26+
config.optimization.splitChunks = {
27+
chunks: "all",
28+
cacheGroups: {
29+
default: {
30+
minChunks: 1,
31+
priority: -20,
32+
reuseExistingChunk: true,
33+
},
34+
vendor: {
35+
test: /[\\/]node_modules[\\/]/,
36+
name: "vendors",
37+
priority: -10,
38+
chunks: "all",
39+
},
40+
},
41+
};
42+
}
43+
return config;
44+
},
45+
1646
// If deploying to root:
1747
// basePath: '/',
1848
// assetPrefix: '/',

0 commit comments

Comments
 (0)