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
This commit is contained in:
parent
677f56f8fb
commit
7a5eee8d21
@ -14,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"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": "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",
|
"lint:fix": "eslint . --fix --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||||
"prettier": "prettier --check \"./**/*.{js,jsx,ts,tsx,css,md,json}\"",
|
"prettier": "prettier --check \"./**/*.{js,jsx,ts,tsx,css,md,json}\"",
|
||||||
|
|||||||
@ -37,8 +37,11 @@ export default defineConfig({
|
|||||||
// navigations like SPA routes; denylist keeps real files out of the fallback.
|
// navigations like SPA routes; denylist keeps real files out of the fallback.
|
||||||
navigateFallback: 'index.html',
|
navigateFallback: 'index.html',
|
||||||
navigateFallbackDenylist: [/\.pdf$/i],
|
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: {
|
manifest: {
|
||||||
name: 'Portfolio',
|
name: 'Portfolio',
|
||||||
short_name: 'Portfolio',
|
short_name: 'Portfolio',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user