front/scripts/postbuild-cleanup-dist.js
zzh d3f300d8b1
All checks were successful
Build and Deploy Front / deploy (push) Successful in 12m44s
feat: 将静态官网迁入 Vue 首页,并优化顾问导航与登录态
EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-06 20:50:57 +08:00

19 lines
678 B
JavaScript

import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const dist = path.join(root, 'dist');
const legacyLoginDir = path.join(dist, 'login');
if (fs.existsSync(legacyLoginDir)) {
fs.rmSync(legacyLoginDir, { recursive: true, force: true });
console.log('[postbuild] removed dist/login (conflicts with SPA route /login)');
}
const faviconSrc = path.join(dist, 'site', 'img', 'logo1.png');
if (fs.existsSync(faviconSrc)) {
fs.copyFileSync(faviconSrc, path.join(dist, 'favicon.png'));
console.log('[postbuild] copied favicon.png from site logo');
}