How to use the electron-rebuild.rebuild function in electron-rebuild

To help you get started, we’ve selected a few electron-rebuild 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 jhen0409 / react-native-debugger / scripts / postinstall.js View on Github external
function rebuildModules(buildPath) {
  if (process.platform === 'darwin') {
    return rebuild({
      buildPath,
      // eslint-disable-next-line
      electronVersion: require('electron/package.json').version,
      extraModules: [],
      force: true,
      types: ['prod', 'optional'],
    });
  }
}
github HadoukenIO / core / Gruntfile.js View on Github external
grunt.registerTask('rebuild-native-modules', 'Rebuild native modules', function() {
        const done = this.async();

        const rebuildOptions = {
            buildPath: __dirname,
            electronVersion: '6.0.2'
        };

        // don't rebuild the optionalDependencies since they're only used
        // on non-Windows systems
        if (process.platform === 'win32') {
            rebuildOptions.types = ['prod'];
        }

        electronRebuild.rebuild(rebuildOptions).then(() => {
            grunt.log.writeln('Rebuild successful!');
            done();
        }).catch(e => {
            grunt.log.error('Rebuilding failed!');
            grunt.log.error(e);
            done();
        });
    });
github hahnlee / throne / script / build.js View on Github external
fs.writeFileSync(
    path.join(outRoot, 'package.json'),
    JSON.stringify(updatedPackage)
  );

  fs.removeSync(path.resolve(outRoot, 'node_modules'));

  if (
    Object.keys(newDependencies).length ||
    Object.keys(newDevDependencies).length
  ) {
    console.log('  Installing npm dependencies…');
    cp.execSync('npm install', { cwd: outRoot, env: process.env });

    console.log('Rebuild Realm');
    rebuild({
      buildPath: outRoot,
      electronVersion: buildPackage.dependencies.electron.substr(1),
      onlyModules: ['realm']
    })
      .then(() => {
        console.info('Rebuild Successful');
        packageApp((err, appPaths) => {
          if (err) {
            console.error(err);
            process.exit(1);
          } else {
            console.log(`Built to ${appPaths}`);
          }
        });
      })
      .catch(e => {
github CircuitCoder / Console-Lite / bin / rebuild.js View on Github external
if(!fs.existsSync(electronPath))
    electronPath = null;
  return electronPath;
}

console.log('Rebuilding native modules...');

const electronBase = locateElectronBase();
const electronPkg = JSON.parse(fs.readFileSync(path.join(electronBase, 'package.json')));
const electronVer = electronPkg.version;

console.log(`Electron version: ${electronVer}`);

const headerURL = process.env.ELECTRON_HEADER;

rebuild({
  buildPath: path.resolve(__dirname, '..'),
  electronVersion: electronVer,
  headerURL,
})
  .then(() => console.info('Rebuild successful'))
  .catch(e => {
    console.error(e);
  });
github introlab / odas_web / build.js View on Github external
(buildPath, electronVersion, platform, arch, callback) => {
            rebuild({ buildPath, electronVersion, arch })
            .then(() => callback())
            .catch((error) => callback(error));
        }
    ],

electron-rebuild

Electron supporting package to rebuild native node modules against the currently installed electron

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis