From 4f160172b981cd7d7bb4f67d2bbe7b5765494601 Mon Sep 17 00:00:00 2001 From: Hugh Kennedy Date: Sun, 26 Oct 2014 19:00:42 +1100 Subject: [PATCH] Add `name` to require call arguments. This allows you to identify the id of the current file, in turn accessing that file's cached require values. This makes it possible, with a few extra steps, to override or ignore the require cache from browserify. --- prelude.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prelude.js b/prelude.js index 3cbac8e..92698b6 100644 --- a/prelude.js +++ b/prelude.js @@ -33,7 +33,7 @@ modules[name][0].call(m.exports, function(x){ var id = modules[name][1][x]; return newRequire(id ? id : x); - },m,m.exports,outer,modules,cache,entry); + },m,m.exports,outer,modules,cache,entry,name); } return cache[name].exports; }