How to use the electron-packager.promise function in electron-packager

To help you get started, we’ve selected a few electron-packager 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 expo / xde / gulp / package-tasks.js View on Github external
async function packageAppAsync(signed) {
  await checkNativeModulesVersionAsync();

  let [xdeVersion, electronVersion] = await Promise.all([
    JsonFile.getAsync(path.join(XDE_ROOT, 'package.json'), 'version'),
    getElectronVersionAsync(),
  ]);

  let iconPath = path.join(XDE_ROOT, 'dev/xde.icns');
  let appPath = await electronPackager.promise({
    dir: path.resolve(__dirname, '..'),
    name: APP_NAME,
    platform: PLATFORM,
    arch: ARCH,
    version: electronVersion,
    'app-bundle-id': APP_BUNDLE_ID,
    'app-copyright': `Copyright (c) ${new Date().getFullYear()} Exponent`,
    'build-version': xdeVersion,
    icon: iconPath,
    ignore: [/^\/src(\/|$)/, /^\/\.babelrc$/],
    overwrite: true,
    prune: true,
    'osx-sign': signed ? { identity: CODE_SIGNING_IDENTITY } : null,
    // sign: signed ? CODE_SIGNING_IDENTITY : null,
  });

electron-packager

Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI

BSD-2-Clause
Latest version published 11 months ago

Package Health Score

56 / 100
Full package analysis