Reputation: 59345
Let's say I have an log.js
with console.log('hi')
, and in another file I have this:
require('./example.js')
require('./example.js')
require('./example.js')
I only get one console.log
of hi
.
What do I have to do so that hi
is logged 3 times?
Upvotes: 0
Views: 19
Reputation: 59345
require('./example.js')
delete require.cache[require.resolve('./example.js')]
require('./example.js')
delete require.cache[require.resolve('./example.js')]
require('./example.js')
Upvotes: 1