fix-reh-bootstrap.patch 980 B

1234567891011121314151617181920
  1. diff --git a/src/bootstrap-esm.ts b/src/bootstrap-esm.ts
  2. index 54681a2..39f72ad 100644
  3. --- a/src/bootstrap-esm.ts
  4. +++ b/src/bootstrap-esm.ts
  5. @@ -6,3 +6,3 @@
  6. import * as fs from 'node:fs';
  7. -import { register } from 'node:module';
  8. +import * as Module from 'node:module';
  9. import { product, pkg } from './bootstrap-meta.js';
  10. @@ -13,3 +13,3 @@ import { INLSConfiguration } from './vs/nls.js';
  11. // Install a hook to module resolution to map 'fs' to 'original-fs'
  12. -if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
  13. +if (Module.register && (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron'])) {
  14. const jsCode = `
  15. @@ -28,3 +28,4 @@ if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
  16. }`;
  17. - register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url);
  18. + // @ts-ignore
  19. + Module.register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url);
  20. }