feat: 添加构建时间信息和相关功能

This commit is contained in:
2026-03-20 22:13:06 +08:00
parent 72e974672e
commit d8d323e293
6 changed files with 95 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ const rootDir = path.resolve(__dirname, '..')
const distDir = path.join(rootDir, 'dist')
const sourceDirs = ['src', 'spec']
const sourceFiles = ['package.json', 'package-lock.json', '.env', 'eslint.config.js']
const buildInfoPath = path.join(distDir, 'build-info.json')
function ensureCleanDir(dirPath) {
fs.rmSync(dirPath, { recursive: true, force: true })
@@ -46,6 +47,17 @@ function build() {
}
}
fs.writeFileSync(
buildInfoPath,
JSON.stringify(
{
buildTime: new Date().toISOString(),
},
null,
2
)
)
console.log('Build completed. Deployable files generated in dist/.')
}