I have 2 files, one named one.js and other name first.js.
one.js
var first = require("./first.js")
require.cache[first.module.id].loaded=false
require("./first.js")
first.js
console.log("First is running");
module.exports={module}
It’s output is:
First is running
and not
First is running
First is running
as I expected. Why is it that even though I set the loaded property of the first.js module to false, it is still not being reloaded?