electron-launcher.js 697 B

12345678910111213141516171819
  1. // Packaged-app launcher: point the backend at the bundled VS Code plugins,
  2. // then boot the real Electron main. In dev (`yarn start`) this file is not
  3. // used: resourcesPath has no `plugins` sibling and the start script already
  4. // passes `--plugins` explicitly, so behaviour there is unchanged.
  5. const path = require('path');
  6. if (!process.env.THEIA_PLUGINS) {
  7. try {
  8. const fs = require('fs');
  9. const dir = path.join(process.resourcesPath, 'plugins');
  10. if (fs.existsSync(dir)) {
  11. process.env.THEIA_PLUGINS = `local-dir:${dir}`;
  12. }
  13. } catch {
  14. // Unexpected layout: fall through to default plugin discovery.
  15. }
  16. }
  17. module.exports = require('./lib/backend/electron-main.js');