require js remove definition to force reload
For testing purposes I am trying to remove some amd modules and reload updated versions from the server - with the goal of not refreshing the browser. I am currently doing the following but the browser still doesn't reload the items from the network. var scripts = document.getElementsByTagName('script'); var context = require.s.contexts['_']; for (var key in context.defined) { if(key.indexOf("tests")>-1){ requirejs.undef(key); for (var i = scripts.length - 1; i >= 0; i--) { var script = scripts[i]; var attr = script.getAttribute('data-requiremodule') if (attr === key){ script.parentNode