feat: 添加构建时间信息和相关功能
This commit is contained in:
@@ -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/.')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user