Skip to content

module: use monkey-patchable `readFileSync`

Through monkey-patching fs and module it's possible to make Node support files in zip archives for commonjs, combined with the experimental loaders the same is possible for ESM. However one line prevents this from working when importing a commonjs file from an ESM file. To fix that this PR updates the commonjs translator to use the monkey-patchable fs.readFileSync instead of destructuring readFileSync from fs.

Refs: https://github.com/yarnpkg/berry/pull/2161

Merge request reports

Loading