import { DevtoolsBackendOptions , DevtoolsBackend , createBackend , BackendContext } from '@vue-devtools/app-backend-api' ; import { backend as backendVue1 } from '@vue-devtools/app-backend-vue1' ; import { backend as backendVue2 } from '@vue-devtools/app-backend-vue2' ; import { backend as backendVue3 } from '@vue-devtools/app-backend-vue3' ; import { handleAddPerformanceTag } from './perf' ; export const availableBackends = [ backendVue1 , backendVue2 , backendVue3 , ] ; const enabledBackends = new Map ( ) ; export function getBackend ( backendOptions , ctx ) { let backend ; if ( ! enabledBackends . has ( backendOptions ) ) { backend = createBackend ( backendOptions , ctx ) ; handleAddPerformanceTag ( backend , ctx ) ; enabledBackends . set ( backendOptions , backend ) ; ctx . backends . push ( backend ) ; } else { backend = enabledBackends . get ( backendOptions ) ; } return backend ; }