Good build

This commit is contained in:
Cris Stringfellow 2023-01-12 17:46:42 +08:00
parent 79663006d9
commit dca96973cc
No known key found for this signature in database
2 changed files with 16 additions and 14 deletions

View File

@ -1,25 +1,22 @@
#!/bin/sh
#!/usr/bin/env bash
#echo "Installing nexe and upx..."
echo "Installing pkg..."
source $HOME/.nvm/nvm.sh
echo "Making build directories..."
mkdir -p dist/
mkdir -p bin/
mkdir -p build/
pkg -v || npm i -g pkg
echo "Setting node to lts/*..."
nvm use --lts
#curl -L -o upx.tar.xz https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
#tar -xJf upx.tar.xz
#rm upx.tar.xz
#sudo cp upx-3.96-amd64_linux/upx /usr/local/bin
#rm -rf upx-3.96-amd64_linux
echo "Installing pkg..."
#./scripts/dl-node.sh
which pkg || npm i -g pkg
# upx packing does not work with pkg
#cd ~/.pkg-cache/v3.2/
#chmod +x *
#upx * || :
echo "Installing esbuild..."
npm install --save-exact esbuild
echo "Done"

View File

@ -1,4 +1,9 @@
#!/usr/bin/env bash
source $HOME/.nvm/nvm.sh
./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/out.cjs --platform=node
nvm use --lts
pkg --compress GZip .