diff --git a/packages/imba/bin/imba.imba b/packages/imba/bin/imba.imba index 25fcec235..7f1a7a808 100644 --- a/packages/imba/bin/imba.imba +++ b/packages/imba/bin/imba.imba @@ -403,6 +403,7 @@ def common cmd common(cli.command('run [script]', { isDefault: true }).description('Imba')) .option("-i, --instances [count]", "Number of instances to start",fmt.i,1) .option("--inspect", "Debug") + .option("--memlimit ", "Set the memory limit of the process") .action(run) common(cli.command('build [script]').description('Build an imba/js/html entrypoint and their dependencies')) diff --git a/packages/imba/src/bundler/runner.imba b/packages/imba/src/bundler/runner.imba index 5e016f54b..c3a198fb8 100644 --- a/packages/imba/src/bundler/runner.imba +++ b/packages/imba/src/bundler/runner.imba @@ -70,6 +70,7 @@ class WorkerInstance execArgv: [ o.inspect and '--inspect', (o.sourcemap or bundle.sourcemapped?) and '--enable-source-maps' + o.memlimit and `--max_old_space_size={o.memlimit}` ].filter do $1 }