ค้นหาเว็บไซต์

javascript - วิธีการคอมไพล์ typescript ด้วยข้อจำกัดหน่วยความจำที่เข้มงวด


ฉันพยายามจะดีพลอยโปรเจ็กต์ Typescript ขนาดเล็กบน instance ของ Heroku สำหรับผู้ชื่นชอบ แต่ขั้นตอนการสร้างล้มเหลวพร้อมกับ FATAL ERROR: Ineffective mark-compacts near heap

คำสั่งสร้างของฉันและ tsconfig มีดังนี้:

tsc && node --optimize_for_size --max_old_space_size=460 dist/main.js
{
  "compilerOptions": {
    "target": "ES2019",
    "module": "CommonJS",
    "strict": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "strictPropertyInitialization": false,
    "removeComments": true,
    "incremental": true,
    "sourceMap": false,
    "declaration": false,
    "outDir": "./dist"
  }
}

บทความที่เกี่ยวข้อง