build: raise Node heap for production build

The production build renders thousands of modules and exceeds V8's
default heap ceiling, so `npm run build` fails with a JavaScript
heap out-of-memory error during "rendering chunks". Set
NODE_OPTIONS=--max-old-space-size=8192 on the Vite build step via
cross-env (kept portable for Windows), so a fresh clone builds
without any manual environment setup. Document the matching Docker
memory requirement in DOCKER.md, since the container build hits the
same limit when the Docker VM has too little RAM.
This commit is contained in:
Alberto Arena
2026-08-04 18:06:11 +02:00
parent ae9e052cf6
commit fe84e0d748
3 changed files with 30 additions and 1 deletions
+2 -1
View File
@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build": "tsc && cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build",
"lint": "eslint -c .eslintrc.json ./src/**/**/*.{ts,tsx} --fix",
"preview": "vite preview"
},
@@ -88,6 +88,7 @@
"@typescript-eslint/parser": "8.11.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "10.4.19",
"cross-env": "^7.0.3",
"esbuild": "^0.28.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "9.1.0",