File size: 396 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os from 'os';

const childProcess = require('child_process');

const totalMemory = Math.floor(os.totalmem() / (1024 * 1024));

if (totalMemory <= 8192) {
  // setting NODE_OPTIONS
  process.env.NODE_OPTIONS = '--max-old-space-size=4096';
}
// Execute project startup command
const args: string[] = process.argv.slice(2);

childProcess.execSync(` ${args.join(' ')}`, { stdio: 'inherit' });