Interface RebuildOptions

interface RebuildOptions {
    arch?: string;
    buildFromSource?: boolean;
    buildPath: string;
    cachePath?: string;
    debug?: boolean;
    disablePreGypCopy?: boolean;
    electronVersion: string;
    extraModules?: string[];
    force?: boolean;
    forceABI?: number;
    headerURL?: string;
    ignoreModules?: string[];
    mode?: RebuildMode;
    onlyModules?: null | string[];
    platform?: Platform;
    prebuildTagPrefix?: string;
    projectRootPath?: string;
    types?: ModuleType[];
    useCache?: boolean;
    useElectronClang?: boolean;
}

Properties

arch?: string

Override the target rebuild architecture to something other than the host system architecture.

Default Value

The system {@link https://nodejs.org/api/process.html#processarch | `process.arch`} value
buildFromSource?: boolean

Skip prebuild download and rebuild module from source.

Default Value

false
buildPath: string

The path to the node_modules directory to rebuild.

cachePath?: string

Sets a custom cache path for the useCache option.

Default Value

a .electron-rebuild-cache folder in the os.homedir() directory

debug?: boolean

Rebuilds a Debug build of target modules. If this is false, a Release build will be generated instead.

Default Value

false
disablePreGypCopy?: boolean

Disables the copying of .node files if not needed.

Default Value

false
electronVersion: string

The version of Electron to build against.

extraModules?: string[]

An array of module names to rebuild in addition to detected modules

Default

[]
force?: boolean

Force a rebuild of modules regardless of their current build state.

forceABI?: number

Override the Application Binary Interface (ABI) version for the version of Electron you are targeting. Only use when targeting nightly releases.

See

the electron/node-abi repository for a list of Electron and Node.js ABIs

headerURL?: string

URL to download Electron header files from.

Default Value

https://www.electronjs.org/headers

ignoreModules?: string[]

Array of module names to ignore during the rebuild process.

mode?: RebuildMode

Whether to rebuild modules sequentially or in parallel.

Default Value

sequential

onlyModules?: null | string[]

An array of module names to rebuild. Only these modules will be rebuilt.

platform?: Platform

Override the target platform to something other than the host system platform. Note: This only applies to downloading prebuilt binaries. It is not possible to cross-compile native modules.

Default Value

The system {@link https://nodejs.org/api/process.html#processplatform | `process.platform`} value
prebuildTagPrefix?: string

GitHub tag prefix passed to prebuild-install.

Default Value

v

projectRootPath?: string

Path to the root of the project if using npm or yarn workspaces.

types?: ModuleType[]

Array of types of dependencies to rebuild. Possible values are prod, dev, and optional.

Default Value

['prod', 'optional']

useCache?: boolean

Enables hash-based caching to speed up local rebuilds.

Default Value

false
useElectronClang?: boolean

Whether to use the clang executable that Electron uses when building. This will guarantee compiler compatibility.

Default Value

false