ES Modules docs states:
require.cache is not used by import. It has a separate cache.
So where's this separate cache? Is it accessible after all?
I'm looking for invalidating module caching as it can be done in CommonJS modules (node.js require() cache - possible to invalidate?)
I saw your thread on the nodeJS github and your answer is there: the cache is designed to be immutable. There's also a good suggestion to use Workers, with each instance having its own fresh imports. Short of that, if you need this behaviour (which doesn't exist for a reason), is there perhaps a better way to design your application to not need it?
EDIT: The issue on GH: https://github.com/nodejs/help/issues/1399
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With