@@ -23,24 +23,23 @@ export class RolldownEventsManager {
2323 build_start_time : number = 0
2424 build_end_time : number = 0
2525
26- interpretSourceRefs ( event : Event , key : string ) {
26+ interpretSourceRefs ( event : Event , key : 'content' ) {
2727 if ( key in event && typeof event [ key as keyof Event ] === 'string' ) {
2828 if ( event [ key as keyof Event ] . startsWith ( '$ref:' ) ) {
2929 const refKey = event [ key as keyof Event ] . slice ( 5 )
3030 if ( this . source_refs . has ( refKey ) ) {
31- ( event as any ) [ key ] = this . source_refs . get ( refKey )
31+ event [ key ] = this . source_refs . get ( refKey ) !
3232 }
3333 }
3434 }
3535 }
3636
3737 recordModuleBuildMetrics ( event : ModuleBuildHookEvents ) {
3838 if ( MODULE_BUILD_START_HOOKS . includes ( event . action ) ) {
39- this . module_build_hook_events . set ( ` ${ event . action } _ ${ event . call_id } ` , event )
39+ this . module_build_hook_events . set ( event . call_id , event )
4040 }
4141 else if ( MODULE_BUILD_END_HOOKS . includes ( event . action ) ) {
42- const start_event_name = `${ event . action . replace ( 'End' , 'Start' ) } _${ event . call_id } `
43- const start = this . module_build_hook_events . get ( start_event_name )
42+ const start = this . module_build_hook_events . get ( event . call_id )
4443 const module_id = event . action === 'HookResolveIdCallEnd' ? event . resolved_id ! : ( event as HookLoadCallEnd | HookTransformCallEnd ) . module_id
4544 if ( start ) {
4645 const info = {
@@ -106,7 +105,6 @@ export class RolldownEventsManager {
106105 return
107106 }
108107
109- this . interpretSourceRefs ( event , 'source' )
110108 this . interpretSourceRefs ( event , 'content' )
111109 this . recordModuleBuildMetrics ( event as ModuleBuildHookEvents )
112110
0 commit comments