Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim vdeturckheim/require.js Secret
Last active Feb 23, 2017

Embed
What would you like to do?
const Module = require(‘module’); // this is a module from Node.js core library
Const load = Module._load;
Module._load = function (request, parent) {
const mod = load.apply(this, arguments); // load the module with the original method
// add hooking logic here
keepTrackOfImport(mod, request, parent);
return mod;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.