SHA256
1
0
forked from pool/rstudio
Files
rstudio/nodejs-bundler.sh

27 lines
642 B
Bash
Executable File

#!/bin/bash
if [[ "$1" =~ [-]?-h(elp)? || ! -f package.json ]]; then
echo "Run this script in rstudio/src/node/desktop/ to download and bundle node_modules."
exit
fi
if ! which pnpm >/dev/null; then
echo "This script requires pnpm."
exit 2
fi
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
echo "=== downloading modules..."
pnpm install --no-frozen-lockfile --ignore-scripts --node-linker=hoisted
rm node_modules/.modules.yaml
echo "=== compressing modules..."
tar --numeric-owner --owner=0 --group=0 --hard-dereference -czf node_modules.tar.gz node_modules
echo "=== cleaning up"
rm -rf node_modules
rm pnpm-lock.yaml
echo "done"