How to use @electron-forge/plugin-base - 1 common examples

To help you get started, we’ve selected a few @electron-forge/plugin-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-forge / packages / api / core / src / util / plugin-interface.ts View on Github external
async overrideStartLogic(opts: StartOptions) {
    let newStartFn;
    const claimed = [];
    for (const plugin of this.plugins) {
      if (typeof plugin.startLogic === 'function' && plugin.startLogic !== PluginBase.prototype.startLogic) {
        claimed.push(plugin.name);
        newStartFn = plugin.startLogic;
      }
    }
    if (claimed.length > 1) {
      throw new Error(`Multiple plugins tried to take control of the start command, please remove one of them\n --> ${claimed.join(', ')}`);
    }
    if (claimed.length === 1 && newStartFn) {
      d(`plugin: "${claimed[0]}" has taken control of the start command`);
      return newStartFn(opts);
    }
    return false;
  }
}

@electron-forge/plugin-base

Base plugin for Electron Forge

MIT
Latest version published 4 days ago

Package Health Score

89 / 100
Full package analysis

Popular @electron-forge/plugin-base functions

Similar packages