Skip to content

Commit

Permalink
fix: remove unnecessary hook for reh
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Oct 7, 2024
1 parent 48cabed commit 314c04a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions patches/linux/reh/node16.patch
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,34 @@ index c107b04..112501b 100644
- "node-pty": "1.1.0-beta21",
+ "node-pty": "1.1.0-beta4",
"tas-client-umd": "0.2.0",
diff --git a/src/bootstrap-amd.js b/src/bootstrap-amd.js
index 9c8daf5..0867d3a 100644
--- a/src/bootstrap-amd.js
+++ b/src/bootstrap-amd.js
@@ -17,3 +17,3 @@ import * as fs from 'fs';
import { fileURLToPath } from 'url';
-import { createRequire, register } from 'node:module';
+import { createRequire } from 'node:module';
import { product, pkg } from './bootstrap-meta.js';
@@ -27,21 +27,2 @@ const module = { exports: {} };
const __dirname = path.dirname(fileURLToPath(import.meta.url));
-
-// Install a hook to module resolution to map 'fs' to 'original-fs'
-if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
- const jsCode = `
- export async function resolve(specifier, context, nextResolve) {
- if (specifier === 'fs') {
- return {
- format: 'builtin',
- shortCircuit: true,
- url: 'node:original-fs'
- };
- }
-
- // Defer to the next hook in the chain, which would be the
- // Node.js default resolve if this is the last user-specified loader.
- return nextResolve(specifier, context);
- }`;
- register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url);
-}
// ESM-uncomment-end

0 comments on commit 314c04a

Please sign in to comment.