diff --git a/lib/index.js b/lib/index.js index c4a4f1b7..fb18c413 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,7 +5,9 @@ * again after this one. */ Object.keys(require.cache).forEach(function(key) { - if (key.indexOf(__dirname) === -1) { + var nativeSuffix = '.node'; + var isNative = key.indexOf(nativeSuffix, key.length - nativeSuffix.length) !== -1; + if (key.indexOf(__dirname) === -1 && !isNative) { delete require.cache[key]; } });