@lark-apaas/coding-template-vite-react 0.1.39 → 0.1.40-beta.0
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
CHANGED
|
@@ -21,8 +21,16 @@ rm -rf "$ROOT/dist"
|
|
|
21
21
|
# 1. Vite 构建 → dist/client/(相对于项目根目录输出)
|
|
22
22
|
npx vite build --outDir "$ROOT/dist/client" --emptyOutDir
|
|
23
23
|
|
|
24
|
-
# 2. HTML → dist/output/
|
|
24
|
+
# 2. public/ 静态资源 + HTML → dist/output/(模型 B:public = 应用根目录,同源 /app/<appId>/*)
|
|
25
25
|
mkdir -p "$OUTPUT"
|
|
26
|
+
# 2a. public/*:vite copyPublicDir 已把 public/* 平铺进 dist/client,但下面白名单只取
|
|
27
|
+
# *.html/routes.json,其余(favicon / 图片 / 运行时 fetch 的数据文件)会随 dist/client 被删。
|
|
28
|
+
# 从源 public/ 补拷到 output/(同源根),让 fetch('/x') / resolveAppUrl('/x') 线上可用。
|
|
29
|
+
# 先拷 public、再拷 HTML,保证构建产出的 index.html/routes.json 覆盖 public 里的同名文件(若有)。
|
|
30
|
+
if [ -d "$ROOT/public" ]; then
|
|
31
|
+
cp -R "$ROOT/public/." "$OUTPUT/"
|
|
32
|
+
fi
|
|
33
|
+
# 2b. HTML + routes.json(构建产物)
|
|
26
34
|
find "$ROOT/dist/client" -maxdepth 1 \( -name '*.html' -o -name 'routes.json' \) -exec cp {} "$OUTPUT/" \;
|
|
27
35
|
|
|
28
36
|
# 3. assets/ → dist/output_resource/(JS/CSS/字体,上传到 CDN)
|