How to use the electron-rebuild.default 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 Eugeny / terminus / scripts / build-native.js View on Github external
#!/usr/bin/env node
const rebuild = require('electron-rebuild').default
const path = require('path')
const vars = require('./vars')

let lifecycles = []
for (let dir of ['app', 'terminus-core', 'terminus-ssh', 'terminus-terminal']) {
    const build = rebuild({
        buildPath: path.resolve(__dirname, '../' + dir),
        electronVersion: vars.electronVersion,
        force: true,
    })
    build.catch(e => {
        console.error(e)
        process.exit(1)
    })
    lifecycles.push([build.lifecycle, dir])
}

console.info('Building against Electron', vars.electronVersion)

for (let [lc, dir] of lifecycles) {
    lc.on('module-found', name => {
        console.info('Rebuilding', dir + '/' + name)
github quanglam2807 / webcatalog / hacky.js View on Github external
.then(({ dependencies }) => {
    const electronVersion = dependencies.electron;

    const opts = {
      buildPath,
      electronVersion,
    };

    console.log(opts);

    return rebuild(opts);
  })
  .then(() => console.info('Rebuild Successful'))
github Eugeny / terminus / scripts / prepackage-plugins.js View on Github external
vars.builtinPlugins.forEach(plugin => {
  log.info('install', plugin)
  sh.cp('-r', path.join('..', plugin), '.')
  sh.rm('-rf', path.join(plugin, 'node_modules'))
  sh.cd(plugin)
  sh.exec(`npm install --only=prod`)
  log.info('rebuild', 'native')
  if (fs.existsSync('node_modules')) {
    rebuild(path.resolve('.'), vars.electronVersion, process.arch, [], true)
  }
  sh.cd('..')
})
fs.unlinkSync(path.join(target, 'package.json'), '{}')

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