Closed seikosantana closed 1 year ago
Yes, named exports do work. I'll have to update the documentation, but it is supported.
In this example you can see the code is calling .default()
you can change that to the name of your export.
/**
* src/index.js
*/
import loadRemoteModule from "./lib/loadRemoteModule";
const main = async () => {
const myModule = await loadRemoteModule(
"http://fake.url/modules/my-module.js"
);
const value = myModule.default();
console.log({ value });
};
main();
Ah yeah sorry forgot to close the issue. I previously tried the method just like you described above and it didn't work. After further investigating I realized that it was loading a disk-cached version.
Again, thanks a lot for the awesome library :grinning:
Hi, is there a way to perform named imports using this library? I managed to fetch and I can see the result of
loadRemodeModule
, but I don't see any way to get what I exported besideexport default
.I am exporting it like