fresh reload of a module
See original GitHub issueCan I reload module to get a fresh copy of a particular module? With node, I can delete require.cache
and get a new copy. Can I do something similar with browserify?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5
Top Results From Across the Web
Reloading modules in Python - GeeksforGeeks
The reload() is a previously imported module. If you've altered the module source file using an outside editor and want to test the...
Read more >How do I unload (reload) a Python module? - Stack Overflow
This defines a reload method which can be called with a module to reload it. For example, reload(math) will reload the math module....
Read more >Reloading a Module - Real Python
In this lesson, you'll learn about reloading a module. For efficiency, a module is only loaded once per interpreter session. That's fine for...
Read more >Reloading module does not reload submodules. #2505 - GitHub
Import-Module modrepo -Force doesn't reload the nested module of modrepo ( Sub.psm1 in this case) when modrepo was already loaded.
Read more >Reloading Python modules - PyUnit
A set of modules are loaded; The modules are used; The code is changed; The modules must be used again, but be freshly...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay so i know this is not the way its ment to be done and i really think browserify should add some sort of module reloading but looking at browserifys require source i found out every module can actually access the module cache using
arguments[5]
its a object with a layout something like{numericModuleId: {exports: /* actual module exports */ }, /*.. other modules*/}
so i wrote me a little function for removing something from the module cache.note you parse the module exports to the clear function not the path. basically you can do
and it will show 2 alerts.
i cant say often enough that doing it this way is a bad idea and may have some results like infinite loops etc.
glad i could help ^^