File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 93
93
"format" : " prettier --write examples src" ,
94
94
"release" : " bumpp package.json examples/*/package.json --commit --push --tag && pnpm publish" ,
95
95
"test" : " vitest" ,
96
+ "test:ci" : " vitest --run" ,
96
97
"typecheck" : " tsc --noEmit" ,
97
98
"preversion" : " pnpm typecheck && pnpm build"
98
99
},
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ import { BuildPackageModule } from './modules/package';
15
15
export * from './types' ;
16
16
17
17
export const UnpluginInfo = createUnplugin < Options | undefined > ( ( options = { } ) => {
18
- let now : Date ;
19
-
20
18
const root = path . resolve ( options ?. root ?? process . cwd ( ) ) ;
21
19
22
20
const modules = {
@@ -30,8 +28,11 @@ export const UnpluginInfo = createUnplugin<Options | undefined>((options = {}) =
30
28
31
29
return {
32
30
name : 'unplugin-info' ,
33
- buildStart ( ) {
34
- now = new Date ( ) ;
31
+ async buildStart ( ) {
32
+ await Promise . all ( Object . values ( modules ) . map ( ( mod ) => mod . buildStart ( this ) ) ) ;
33
+ } ,
34
+ async buildEnd ( ) {
35
+ await Promise . all ( Object . values ( modules ) . map ( ( mod ) => mod . buildEnd ( this ) ) ) ;
35
36
} ,
36
37
resolveId ( id ) {
37
38
if (
@@ -69,7 +70,7 @@ export const UnpluginInfo = createUnplugin<Options | undefined>((options = {}) =
69
70
handleHotUpdate ( { file, server } ) {
70
71
// HMR: package.json
71
72
if ( file === normalizePath ( path . resolve ( root , 'package.json' ) ) ) {
72
- const module = server . moduleGraph . getModuleById ( '\0' + modules . Package ) ;
73
+ const module = server . moduleGraph . getModuleById ( '\0' + modules . Package . name ) ;
73
74
if ( module ) {
74
75
// Invalidate module for reloading
75
76
server . moduleGraph . invalidateModule ( module ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,6 @@ import { BuildGitModule } from './git';
5
5
export class LegacyInfoModule extends BuildGitModule {
6
6
constructor ( root : string , options : Options ) {
7
7
super ( root , options ) ;
8
- this . name = `${ options . prefix } /info` ;
8
+ this . name = `${ options . prefix ?? '~build' } /info` ;
9
9
}
10
10
}
You can’t perform that action at this time.
0 commit comments