import type { ChunkManager , LazyComponentState } from './types' ; function exportedComponent ( mod ) { return Object . hasOwnProperty . call ( mod , 'default' ) ? ( mod as any ) . default : mod ; } export function register ( chunkManager , chunk , lazyImport , mod ) { const component = exportedComponent ( mod ) ; const lazyComponentState = { state : 'loaded' , component , } ; if ( process . env . NOSTALGIE_BUILD_TARGET === 'server' ) { if ( chunk ) { chunkManager . chunks . push ( { chunk , lazyImport } ) ; } } chunkManager . lazyComponentState . set ( lazyImport , lazyComponentState ) ; return lazyComponentState ; }