Fix frontend build dependencies

This commit is contained in:
2026-03-28 22:39:14 +08:00
parent 728cf36e7c
commit e69c637dba
3 changed files with 8 additions and 3 deletions

View File

@@ -31,6 +31,7 @@
"lucide-react": "^0.544.0", "lucide-react": "^0.544.0",
"react": "^19.1.1", "react": "^19.1.1",
"react-dom": "^19.1.1", "react-dom": "^19.1.1",
"react-is": "^19.2.0",
"react-markdown": "^10.1.0", "react-markdown": "^10.1.0",
"recharts": "^3.2.1", "recharts": "^3.2.1",
"remark-gfm": "^4.0.1", "remark-gfm": "^4.0.1",
@@ -11884,8 +11885,7 @@
"version": "19.2.4", "version": "19.2.4",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.4.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.4.tgz",
"integrity": "sha512-W+EWGn2v0ApPKgKKCy/7s7WHXkboGcsrXE+2joLyVxkbyVQfO3MUEaUQDHoSmb8TFFrSKYa9mw64WZHNHSDzYA==", "integrity": "sha512-W+EWGn2v0ApPKgKKCy/7s7WHXkboGcsrXE+2joLyVxkbyVQfO3MUEaUQDHoSmb8TFFrSKYa9mw64WZHNHSDzYA==",
"license": "MIT", "license": "MIT"
"peer": true
}, },
"node_modules/react-markdown": { "node_modules/react-markdown": {
"version": "10.1.0", "version": "10.1.0",

View File

@@ -40,6 +40,7 @@
"lucide-react": "^0.544.0", "lucide-react": "^0.544.0",
"react": "^19.1.1", "react": "^19.1.1",
"react-dom": "^19.1.1", "react-dom": "^19.1.1",
"react-is": "^19.2.0",
"react-markdown": "^10.1.0", "react-markdown": "^10.1.0",
"recharts": "^3.2.1", "recharts": "^3.2.1",
"remark-gfm": "^4.0.1", "remark-gfm": "^4.0.1",

View File

@@ -174,7 +174,11 @@ build_frontend() {
echo "" echo ""
echo -e "${CYAN}构建前端...${NC}" echo -e "${CYAN}构建前端...${NC}"
if [ -d "frontend" ] && command -v npm >/dev/null 2>&1; then if [ -d "frontend" ] && command -v npm >/dev/null 2>&1; then
(cd frontend && npm install --legacy-peer-deps && npm run build) if [ -f "frontend/package-lock.json" ]; then
(cd frontend && npm ci && npm run build)
else
(cd frontend && npm install && npm run build)
fi
echo -e "${GREEN}前端构建完成: ${FRONTEND_DIST}${NC}" echo -e "${GREEN}前端构建完成: ${FRONTEND_DIST}${NC}"
else else
echo -e "${RED}前端构建失败: 需要 npm 和 frontend 目录${NC}" echo -e "${RED}前端构建失败: 需要 npm 和 frontend 目录${NC}"