chore: 导入清理前的完整工程状态(含 Capacitor 原生壳,作为回滚备份点)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { cpSync, existsSync, rmSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
// Deploy targets (Netlify, Vercel, Cloudflare Pages, EdgeOne, Docker, Capacitor) 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/')
|
||||
Reference in New Issue
Block a user