Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto-reload files in Node.js while using ESM?

I understand you can clear files from cache while using CommonJS simply by deleteing from require.cache and requireing the file again. However I've been unable to find an equivalent option when using ESM. Is this possible, and if so how?

like image 477
ElJay Avatar asked Apr 09 '26 14:04

ElJay


1 Answers

Reading at esm issues it seems cache is intentionally not exposed.

I'm afraid the answer to your question is simply no.

like image 140
Daniele Ricci Avatar answered Apr 11 '26 04:04

Daniele Ricci



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!