删除 android/、ios/ 两个 Capacitor 原生工程与 capacitor.config.ts、 ionic.config.json,以及 scripts/android、scripts/ios.sh 构建脚本; 根与 apps/web 的 @capacitor/* 依赖和相关 npm scripts 一并移除。 Web 侧去掉原生分支:登录只走云乐坊容器授权面板或顶层重定向, 暗色模式不再改原生状态栏,移除 Android 物理返回键处理。 保留 @nuxtjs/ionic(Web UI 框架)、云乐坊 window.ylf 桥接与 PWA。 决策记录见 docs/decisions/0004-web-only.md。
17 lines
653 B
TypeScript
17 lines
653 B
TypeScript
import { cpSync, existsSync, rmSync } from 'node:fs'
|
|
import { resolve } from 'node:path'
|
|
|
|
// Deploy targets (Netlify, Vercel, Cloudflare Pages, EdgeOne, Docker) read `dist/`
|
|
// at the repo root, so mirror the web app's static output there.
|
|
const root = resolve(import.meta.dirname, '..')
|
|
const webDist = resolve(root, 'apps/web/dist')
|
|
const rootDist = resolve(root, 'dist')
|
|
|
|
if (!existsSync(webDist))
|
|
throw new Error('apps/web/dist not found, run `pnpm -C apps/web run generate` first')
|
|
|
|
rmSync(rootDist, { recursive: true, force: true })
|
|
cpSync(webDist, rootDist, { recursive: true, dereference: true })
|
|
|
|
console.log('Copied apps/web/dist to dist/')
|