function createJBrowsePluginTsdxConfig ( config , options , globals ) { if ( options . format === 'umd' ) { const originalExternal = config . external ; config . external = ( ... args ) => { const isExternal = originalExternal ( ... args ) ; if ( isExternal ) { const id = args [ 0 ] ; if ( ! globals . includes ( id ) ) { try { require . resolve ( id ) ; return false ; } catch { } } } return isExternal ; } ; globals . forEach ( global => { config . output . globals [ global ] = `JBrowseExports.${ global }` ; } ) ; } return config ; } exports . createJBrowsePluginTsdxConfig = createJBrowsePluginTsdxConfig ;