Switch to dart-sass and make deploy script fail-safe

node-sass 4.x cannot build on arm64/Node 16. Use sass with ::v-deep
instead of /deep/, and only replace the server dist after the upload
is unpacked and verified.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-17 19:18:37 +08:00
co-authored by Claude Opus 5
parent 276636f70f
commit e282bd23e8
78 changed files with 20279 additions and 219 deletions
+5 -1
View File
@@ -1,6 +1,10 @@
# sh 执行打包到正式服上
set -e
npm run build
test -f dist/index.html
rm -f dist.zip
zip -q -r dist.zip dist
scp dist.zip root@172.104.39.32:/tmp/dist.zip
ssh root@172.104.39.32 "cd /server/91fans/webadmin/dist/ && rm -rf ./* && unzip -q /tmp/dist.zip -d /tmp/extract && mv /tmp/extract/dist/* . && rm -rf /tmp/extract /tmp/dist.zip && echo DEPLOY_OK"
# 先解压并校验,成功后再替换线上目录,避免失败时清空线上
ssh root@172.104.39.32 "set -e; rm -rf /tmp/extract && unzip -q /tmp/dist.zip -d /tmp/extract && test -f /tmp/extract/dist/index.html && cd /server/91fans/webadmin/dist/ && rm -rf ./* && mv /tmp/extract/dist/* . && rm -rf /tmp/extract /tmp/dist.zip && echo DEPLOY_OK"
rm dist.zip