Skip to content

Commit

Permalink
Fix Bun compatibility (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
busybox11 authored Feb 2, 2025
1 parent 75e8b16 commit 972690b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ module.exports = moduleId => {

const parent = require.cache[parentPath]; // If `filePath` and `parentPath` are the same, cache will already be deleted so we won't get a memory leak in next step

return parent === undefined ? require(filePath) : parent.require(filePath); // In case cache doesn't have parent, fall back to normal require
// In case cache doesn't have parent, fall back to normal require
return parent === undefined || parent.require === undefined ? require(filePath) : parent.require(filePath);
};

0 comments on commit 972690b

Please sign in to comment.