Reload script file after editing? #523
-
Hi, search as I might I can't find any clear references on reloading a script in a running host application after making edits. Is there a method to load/reload a script after edits? I've tried 'Execute' on the same file but it seems it's not replacing it as expected/hoped. When I call the sample code below everything works fine and modules are imported as expected, I make a change to one of the imported files, rerun this code but the changes are not being processed.
Am I missing something simple? Thanks for any ideas, cheers. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It's always the way, you find the solution after asking the question... This seems to be working for now, cheers.
solution found here: #187 Thanks p.s. |
Beta Was this translation helpful? Give feedback.
-
hmm, CacheDocument is a no go at the moment, I'm getting an exception:
Any suggestions on how to 'reload' a script file from the 'engine' or is there a way to do this in JavaScript code run by the engine (hot reload)? The DiscardCachedDocuments works fine for the moment but I can see this being a problem once I have whole applications with lots of script files/modules running within the script engine. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response! |
Beta Was this translation helpful? Give feedback.
It's always the way, you find the solution after asking the question...
This seems to be working for now, cheers.
solution found here: #187
Thanks
p.s.
There is also the DocumentLoader.CacheDocument Method that I need to look into for individual script file replacement, hth.