sindresorhus / clear-module

Clear a module from the cache
MIT License
182 stars 25 forks source link

Support ESM #17

Open sindresorhus opened 3 years ago

sindresorhus commented 3 years ago

We need to wait for the loader hooks to be stable first: https://nodejs.org/dist/latest/docs/api/esm.html#esm_hooks

electrovir commented 1 year ago

Is this ticket the reason why my import below isn't getting a fresh module?

clearModule(moduleId);
await import(moduleId); // isn't fresh