Skip to content

Commit dd21955

Browse files
Jake Mahonclaude
authored andcommitted
Optimize build for memory usage
- Increase Node.js memory limit to 31GB - Disable memory-intensive optimization features: - swcJsLoader, swcJsMinimizer, swcHtmlMinimizer - lightningCssMinimizer, rspackBundler - rspackPersistentCache, ssgWorkerThreads - Keep mdxCrossCompilerCache for essential performance - Address Netlify build failure (exit code 137 - memory exhaustion) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fc02bc7 commit dd21955

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

docusaurus.config.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ const config = {
3232
themes: ['@docusaurus/theme-mermaid'],
3333

3434
// Performance optimizations with Docusaurus Faster
35+
// Temporarily disabled memory-intensive optimizations for build stability
3536
future: {
3637
experimental_faster: {
37-
swcJsLoader: true,
38-
swcJsMinimizer: true,
39-
swcHtmlMinimizer: true,
40-
lightningCssMinimizer: true,
41-
rspackBundler: true,
42-
rspackPersistentCache: true, // 2-5x faster rebuilds
43-
mdxCrossCompilerCache: true,
44-
ssgWorkerThreads: true, // 2x faster static generation
38+
swcJsLoader: false, // Disabled to reduce memory usage
39+
swcJsMinimizer: false, // Disabled to reduce memory usage
40+
swcHtmlMinimizer: false, // Disabled to reduce memory usage
41+
lightningCssMinimizer: false, // Disabled to reduce memory usage
42+
rspackBundler: false, // Disabled to reduce memory usage
43+
rspackPersistentCache: false, // Disabled to reduce memory usage
44+
mdxCrossCompilerCache: true, // Keep this for speed
45+
ssgWorkerThreads: false, // Disabled to reduce memory usage
4546
},
4647
v4: {
4748
removeLegacyPostBuildHeadAttribute: true, // Required for worker threads

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"docusaurus": "npx docusaurus",
88
"start": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=false npx docusaurus start --port=4500 --no-open",
99
"start-chok": "cross-env NODE_OPTIONS=--max-old-space-size=16384 CHOKIDAR_USEPOLLING=true npx docusaurus start --port=4500 --no-open",
10-
"build": "cross-env NODE_OPTIONS=--max-old-space-size=16384 npx docusaurus build",
10+
"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=31744 --max_old_space_size=31744\" npx docusaurus build",
1111
"swizzle": "npx docusaurus swizzle",
1212
"clear": "npx docusaurus clear",
1313
"serve": "npx serve -s build -l 8080",

0 commit comments

Comments
 (0)