Skip to content

Commit

Permalink
fix: get build time to buildStart hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Jan 26, 2024
1 parent 747f5d0 commit 825c808
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { getRepoUrl } from './repo';
export * from './types';

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

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

return {
name: 'unplugin-info',
buildStart() {
now = new Date();
},
resolveId(id) {
if (Object.values(ModuleName).includes(id)) {
return `\0${id}`;
Expand Down

0 comments on commit 825c808

Please sign in to comment.