main.js 381 B

123456789101112131415
  1. const { app, utilityProcess } = require('electron');
  2. const path = require('node:path');
  3. app.whenReady().then(() => {
  4. const child = utilityProcess.fork(path.join(__dirname, 'noop.js'), [], {
  5. stdio: 'inherit',
  6. env: {
  7. ...process.env,
  8. NODE_OPTIONS: `--require ${path.join(__dirname, 'fail.js')}`
  9. }
  10. });
  11. child.once('exit', (code) => app.exit(code));
  12. });