Practical fixes
package.json
{
"scripts": {
"build": "vite build",
"build:ci": "NODE_OPTIONS=--max-old-space-size=4096 vite build"
}
}vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({
build: {
sourcemap: false,
chunkSizeWarningLimit: 1200,
},
});Practical tip
OOM is often a symptom. Use bundle analysis and lazy loading to remove the root memory pressure.