Skip to content

Commit 825c808

Browse files
committed
fix: get build time to buildStart hooks
1 parent 747f5d0 commit 825c808

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { getRepoUrl } from './repo';
1313
export * from './types';
1414

1515
export const UnpluginInfo = createUnplugin<Options | undefined>((option) => {
16-
const now = new Date();
16+
let now: Date;
1717

1818
const root = path.resolve(option?.root ?? process.cwd());
1919
const info = getRepoInfo(root);
@@ -30,6 +30,9 @@ export const UnpluginInfo = createUnplugin<Options | undefined>((option) => {
3030

3131
return {
3232
name: 'unplugin-info',
33+
buildStart() {
34+
now = new Date();
35+
},
3336
resolveId(id) {
3437
if (Object.values(ModuleName).includes(id)) {
3538
return `\0${id}`;

0 commit comments

Comments
 (0)