This commit is contained in:
Cris Stringfellow 2022-03-03 12:03:47 +08:00
parent fad672d802
commit 4e62666749
2 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,7 @@
}, },
"scripts": { "scripts": {
"bundle": "npx rollup --config", "bundle": "npx rollup --config",
"start": "node src/app.js", "start": "bash ./run.sh",
"setup": "bash ./scripts/build_setup.sh", "setup": "bash ./scripts/build_setup.sh",
"build": "echo 'please run ./scripts/build_setup.sh first (one time only) and then ./scripts/compile.sh'", "build": "echo 'please run ./scripts/build_setup.sh first (one time only) and then ./scripts/compile.sh'",
"clean": "rm -rf build/* bin/*", "clean": "rm -rf build/* bin/*",

6
run.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
phys=$(free -t -m | grep -oP '\d+' | sed '10!d')
alloc=$(echo "$phys * 90/100" | bc )
echo $alloc
node --max-old-space-size=$alloc src/app.js