import { writeFile } from 'fs/promises';
import dayjs from 'dayjs';

import packageJson from '../package.json';

const now = dayjs();

const versionInfo = {
  version: packageJson.version,
  buildTime: now.format('YYYY-MM-DD HH:mm:ss'),
};

try {
  await writeFile('./public/manifest.json', JSON.stringify(versionInfo, null, 2));
} catch (error) {
  console.error('写入manifest失败:', error);
}
