Update for clean pnpm store before pnpm build

This commit is contained in:
timqiu 2025-03-24 12:29:42 +08:00
parent c166e61f9f
commit 2b1c13c01e

View File

@ -787,15 +787,17 @@ if true ; then
cp pnpm-lock.yaml /tmp/pnpm-lock.yaml.bak
fi
# Remove node_modules directory
rm -rf node_modules
# 4⃣ Install dependencies
pnpm store prune
# 4⃣ Install dependencies (ensuring lockfile updates)
pnpm install --no-frozen-lockfile \\
--shamefully-hoist \\
--link-workspace-packages false \\
--store-dir /home/devbox/.pnpm-store
--store-dir /home/tmp/.pnpm-store
# 4⃣ Build the frontend
pnpm run build
@ -1197,21 +1199,24 @@ docker exec -i "$DEVBOX_NAME" bash <<EOF
# Clean up old dependencies
rm -rf node_modules
# Clean up old pnpm store
pnpm store prune
# Backup the pnpm-lock.yaml file
if [ -f "pnpm-lock.yaml" ]; then
mv pnpm-lock.yaml /tmp/pnpm-lock.yaml.bak
fi
# if /home/devbox/.pnpm-store exists, remove it
if [ -d "/home/devbox/.pnpm-store" ]; then
rm -rf /home/devbox/.pnpm-store
# if /home/tmp/.pnpm-store exists, remove it
if [ -d "/home/tmp/.pnpm-store" ]; then
rm -rf /home/tmp/.pnpm-store
fi
# Install dependencies
pnpm install --no-frozen-lockfile \\
--shamefully-hoist \\
--link-workspace-packages false \\
--store-dir /home/devbox/.pnpm-store || {
--store-dir /home/tmp/.pnpm-store || {
echo
echo "============================================================================================"
echo