代码提交
This commit is contained in:
1 parent
5901246030
commit
47faa9bcdf
7 files changed
+767
-227
No files matched your search
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
FRONTEND="${ROOT}/frontend-web"
|
||||
OUTPUT_DIR="${1:-${ROOT}/dist}"
|
||||
ARCHIVE="${OUTPUT_DIR}/frontend-offline-deps.tar.gz"
|
||||
|
||||
if [[ ! -d "${FRONTEND}/node_modules/.pnpm" ]]; then
|
||||
echo "frontend-web/node_modules is missing or incomplete. Run 'pnpm install' in frontend-web first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "${OUTPUT_DIR}"
|
||||
rm -f "${ARCHIVE}"
|
||||
|
||||
echo "Packaging frontend dependencies..."
|
||||
echo " Source: ${FRONTEND}"
|
||||
echo " Output: ${ARCHIVE}"
|
||||
|
||||
tar -czhf "${ARCHIVE}" -C "${FRONTEND}" node_modules package.json pnpm-lock.yaml
|
||||
|
||||
SIZE_MB=$(du -m "${ARCHIVE}" | awk '{print $1}')
|
||||
echo ""
|
||||
echo "Done — ${SIZE_MB} MB"
|
||||
echo ""
|
||||
echo "Copy to offline machine, then run:"
|
||||
echo " scripts/restore-frontend-offline-deps.sh <path-to-archive>"
|
||||
Reference in new issue
Block a user