Skip to content

Commit a77e322

Browse files
committed
Fix polyfill module
In require method clear module.exports after importing by null instead of undefined. In that case modules cache would work fine for modules without export
1 parent 863a68a commit a77e322

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/polyfill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function require(path) {
1515
// Add module to cache
1616
c = module._cache[path] = module.exports;
1717
// clean exports data to prevent modules duplication
18-
module.exports = undefined;
18+
module.exports = null;
1919

2020
return c;
2121
}

0 commit comments

Comments
 (0)