File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export async function build(
3737 minify,
3838 watch,
3939 unused,
40+ onSuccess,
4041 } = resolved
4142
4243 if ( clean ) await cleanOutDir ( outDir , clean )
@@ -96,6 +97,7 @@ export async function build(
9697 performance . now ( ) - startTime ,
9798 ) } ms`,
9899 )
100+ await onSuccess ?.( )
99101 }
100102}
101103
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export interface Options {
5252 options : OutputOptions ,
5353 format : Format ,
5454 ) => MaybePromise < OutputOptions | void | null > )
55+ onSuccess ?: ( ) => void | Promise < void >
5556}
5657
5758/**
@@ -63,7 +64,12 @@ export type ResolvedOptions = Omit<
6364 Overwrite <
6465 MarkPartial <
6566 Options ,
66- 'inputOptions' | 'outputOptions' | 'minify' | 'alias' | 'external'
67+ | 'inputOptions'
68+ | 'outputOptions'
69+ | 'minify'
70+ | 'alias'
71+ | 'external'
72+ | 'onSuccess'
6773 > ,
6874 { format : Format [ ] ; clean : string [ ] | false }
6975 > ,
@@ -96,6 +102,7 @@ export async function normalizeOptions(
96102 watch = false ,
97103 inputOptions,
98104 outputOptions,
105+ onSuccess,
99106 } = options
100107
101108 entry = await resolveEntry ( entry )
@@ -120,6 +127,7 @@ export async function normalizeOptions(
120127 watch,
121128 inputOptions,
122129 outputOptions,
130+ onSuccess,
123131 }
124132}
125133
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ export default defineConfig({
77 platform : 'node' ,
88 dts : true ,
99 unused : { level : 'error' } ,
10+ onSuccess ( ) {
11+ console . info ( '🙏 Build succeeded!' )
12+ } ,
1013
1114 // TODO
1215 // target: 'node18',
You can’t perform that action at this time.
0 commit comments