Skip to content

Instantly share code, notes, and snippets.

@honzabrecka
Created September 10, 2019 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save honzabrecka/855b488b5a4a3afe18745251f51529b0 to your computer and use it in GitHub Desktop.
Save honzabrecka/855b488b5a4a3afe18745251f51529b0 to your computer and use it in GitHub Desktop.
// require without cache
const __r = (m) => { delete require.cache[require.resolve(m)]; return require(m) }
const reload = () = {
Object.keys(require.cache).forEach((module) => {
delete require.cache[module]
require(module)
})
}
global.__r = __r
global.reload = reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment