mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 20:38:45 +08:00
9ba577f3df
Co-authored-by: lijianan <574980606@qq.com>
15 lines
396 B
TypeScript
15 lines
396 B
TypeScript
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' });
|