From 7a5eee8d2135a0d9b4be3e24ef0ea4f5bc37c7b2 Mon Sep 17 00:00:00 2001 From: ilia Date: Tue, 24 Mar 2026 23:05:42 -0400 Subject: [PATCH] build: avoid PWA OOM on small VPS (heap + skip PDF precache) - Set NODE_OPTIONS max-old-space-size=3072 for tsc and vite build - Workbox globIgnores PDFs; drop resume.pdf from PWA includeAssets Made-with: Cursor --- package.json | 2 +- vite.config.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 492eb46..d0692b8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "scripts": { "dev": "vite", - "build": "tsc && vite build", + "build": "NODE_OPTIONS=--max-old-space-size=3072 tsc && NODE_OPTIONS=--max-old-space-size=3072 vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "eslint . --fix --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "prettier": "prettier --check \"./**/*.{js,jsx,ts,tsx,css,md,json}\"", diff --git a/vite.config.ts b/vite.config.ts index 39ae59d..ad7299e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -37,8 +37,11 @@ export default defineConfig({ // navigations like SPA routes; denylist keeps real files out of the fallback. navigateFallback: 'index.html', navigateFallbackDenylist: [/\.pdf$/i], + // Large binaries in precache inflate Workbox memory during `vite build` on small VPSs. + globIgnores: ['**/*.pdf'], }, - includeAssets: ['logo.png', 'resume.pdf'], + // resume.pdf: serve from /resume.pdf; do not precache (cache quota + build RAM). + includeAssets: ['logo.png'], manifest: { name: 'Portfolio', short_name: 'Portfolio',