Search code examples
node.jses6-modules

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?


Solution

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

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