import { __federation_method_setRemote, __federation_method_getRemote, __federation_method_unwrapDefault, } from '__federation__'; export const getModule = async ( scope: string, url: string, element: string, ) => { try { await __federation_method_setRemote(scope, { url: () => Promise.resolve(url), format: 'esm', from: 'vite', }); const moduleWrapper = await __federation_method_getRemote(scope, element); const module = await __federation_method_unwrapDefault(moduleWrapper); return module; } catch (e) { console.error(e); } };