cli的build支持了stackSize参数设置node最大栈大小

This commit is contained in:
Pan Qiancheng 2024-11-28 14:24:23 +08:00
parent 0b2c18b363
commit 48bdd6631f
2 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,7 @@ export default async function build(cmd: any) {
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
`node`,
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
cmd.stackSize && `--stack_size=${cmd.stackSize}`,
resolve(__dirname, `../scripts/${mpFileMap[mode]}`),
].filter(Boolean),
{
@ -104,6 +105,7 @@ export default async function build(cmd: any) {
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
`node`,
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
cmd.stackSize && `--stack_size=${cmd.stackSize}`,
resolve(__dirname, `../scripts/${webFileMap[mode]}`),
].filter(Boolean),
{

View File

@ -71,6 +71,7 @@ program
.option('--sourcemap', 'sourcemap')
.option('--analyze', 'analyze')
.option('--memoryLimit <memoryLimit>', 'memoryLimit of node')
.option('--stackSize <number>', 'stackSize of node')
.option('-t, --target <target>', 'target')
.option('-m, --mode <mode>', 'mode')
.option('-d, --subDir <subDirName>', 'subDirName')
@ -84,6 +85,7 @@ program
.option('--sourcemap', 'sourcemap')
.option('--analyze', 'analyze')
.option('--memoryLimit <memoryLimit>', 'memoryLimit of node')
.option('--stackSize <number>', 'stackSize of node')
.option('-t, --target <target>', 'target')
.option('-m, --mode <mode>', 'mode')
.option('-d, --subDir <subDirName>', 'subDirName')