Created
September 22, 2015 06:29
-
-
Save ORESoftware/673d66ef03adabc897a2 to your computer and use it in GitHub Desktop.
hotReloader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function () { | |
var hotReloadSimple = function (item, callback) { | |
require.undef(item); //delete cache representing module; this means the next require call to the same module will then have to pull the module from filesystem | |
require([item], function (module) { //load the file asynchronously, because the cache has been deleted | |
callback(null, module); | |
}); | |
}; | |
return { | |
hotReload:hotReloadSimple | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment