deno
e821e1ac - fix(node): use fs.readFileSync in CJS module loader for monkey-patch compat

Commit
199 days ago
fix(node): use fs.readFileSync in CJS module loader for monkey-patch compat Deno's CJS require system was using `op_require_read_file` (a direct Rust op) to read module source files, bypassing the `node:fs` module entirely. This broke tools like vue-tsc (@volar/typescript) that monkey-patch `fs.readFileSync` to intercept and transform source files during require(). Switch to `fs.readFileSync` in the CJS/JSON extension handlers so that monkey-patches are respected. Fall back to `op_require_read_file` for virtual files (like `$deno$eval.cjs`) that don't exist on disk. Closes #30977 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Parents
Loading