josemariagomez / momentum-modal-react

MIT License
6 stars 2 forks source link

Support modals which are not imported with flag eager:true #1

Open aleksandrrf opened 2 months ago

aleksandrrf commented 2 months ago

In case of using import.meta.glob without flag {eager: true}, it is not working.

globalThis.resolveMomentumModal = async (name) => {
    const modals = import.meta.glob('./Pages/**/*.jsx');
    return await modals[`./Pages/${name}/index.jsx`]();
}

Errors:

image

I fixed the issue on this PR. Please check it.

Thanks.

josemariagomez commented 2 months ago

Hey! Thanks for the fix, I'll give it a try and merge asap 🤝

aleksandrrf commented 1 month ago

@josemariagomez Do you have any plans to merge this PR ?