@lark-apaas/fullstack-cli 1.1.34-alpha.0 → 1.1.34-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/scripts/build.sh +10 -10
package/package.json
CHANGED
|
@@ -42,9 +42,9 @@ echo ""
|
|
|
42
42
|
# ==================== 步骤 3 ====================
|
|
43
43
|
STEP_START=$(node -e "console.log(Date.now())")
|
|
44
44
|
|
|
45
|
-
# 根据
|
|
46
|
-
if [[ "${
|
|
47
|
-
echo "🔨 [3/5] 仅构建 client (
|
|
45
|
+
# 根据 only_frontend_change 决定是否构建 server
|
|
46
|
+
if [[ "${only_frontend_change:-false}" == "true" ]]; then
|
|
47
|
+
echo "🔨 [3/5] 仅构建 client (only_frontend_change=true)"
|
|
48
48
|
|
|
49
49
|
echo " ├─ 启动 client 构建..."
|
|
50
50
|
npm run build:client > /tmp/build-client.log 2>&1
|
|
@@ -104,12 +104,12 @@ STEP_START=$(node -e "console.log(Date.now())")
|
|
|
104
104
|
# HTML 文件属于前端产物,始终执行
|
|
105
105
|
if [ -d "$DIST_DIR/client" ]; then
|
|
106
106
|
mkdir -p "$DIST_DIR/dist/client"
|
|
107
|
-
find "$DIST_DIR/client" -maxdepth 1 -name "*.html" -exec
|
|
107
|
+
find "$DIST_DIR/client" -maxdepth 1 -name "*.html" -exec cp {} "$DIST_DIR/dist/client/" \;
|
|
108
108
|
fi
|
|
109
109
|
|
|
110
|
-
# server 相关产物准备(
|
|
111
|
-
if [[ "${
|
|
112
|
-
echo " [skip] 跳过 run.sh/.env 复制 (
|
|
110
|
+
# server 相关产物准备(only_frontend_change=true 时跳过)
|
|
111
|
+
if [[ "${only_frontend_change:-false}" == "true" ]]; then
|
|
112
|
+
echo " [skip] 跳过 run.sh/.env 复制 (only_frontend_change=true)"
|
|
113
113
|
else
|
|
114
114
|
# 拷贝 run.sh 到 dist/(prod 从 dist/ 启动,确保 cwd 一致性)
|
|
115
115
|
cp "$ROOT_DIR/scripts/run.sh" "$DIST_DIR/"
|
|
@@ -131,8 +131,8 @@ echo ""
|
|
|
131
131
|
STEP_START=$(node -e "console.log(Date.now())")
|
|
132
132
|
|
|
133
133
|
# 智能依赖裁剪(仅全量构建时执行,纯前端场景不打包 server,无需裁剪)
|
|
134
|
-
if [[ "${
|
|
135
|
-
echo "✂️ [5/5] 跳过智能依赖裁剪 (
|
|
134
|
+
if [[ "${only_frontend_change:-false}" == "true" ]]; then
|
|
135
|
+
echo "✂️ [5/5] 跳过智能依赖裁剪 (only_frontend_change=true)"
|
|
136
136
|
else
|
|
137
137
|
echo "✂️ [5/5] 智能依赖裁剪"
|
|
138
138
|
|
|
@@ -149,7 +149,7 @@ print_time $TOTAL_START
|
|
|
149
149
|
|
|
150
150
|
# 输出产物信息
|
|
151
151
|
DIST_SIZE=$(du -sh "$DIST_DIR" | cut -f1)
|
|
152
|
-
if [[ "${
|
|
152
|
+
if [[ "${only_frontend_change:-false}" == "true" ]]; then
|
|
153
153
|
echo ""
|
|
154
154
|
echo "📊 构建产物统计:"
|
|
155
155
|
echo " 产物大小: $DIST_SIZE"
|