Skip to content

Commit 0d3b87f

Browse files
authored
fix: properly configure electron-rebuild for monorepos (#7215)
1 parent 53327d5 commit 0d3b87f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/fresh-experts-clap.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
fix: Using electron-rebuild for finding project root for native node addons to correctly handle monorepo setups

packages/app-builder-lib/src/util/yarn.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import { homedir } from "os"
55
import * as path from "path"
66
import { Configuration } from "../configuration"
77
import { NodeModuleDirInfo } from "./packageDependencies"
8-
import * as electronRebuild from "electron-rebuild"
98
import { getElectronVersion } from "../electron/electronVersion"
9+
import * as electronRebuild from "electron-rebuild"
10+
import * as searchModule from "electron-rebuild/lib/src/search-module"
1011

1112
export async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {
1213
let isDependenciesInstalled = false
@@ -156,6 +157,7 @@ export async function rebuild(appDir: string, buildFromSource: boolean, arch = p
156157
arch,
157158
force: true,
158159
debug: log.isDebugEnabled,
160+
projectRootPath: await searchModule.getProjectRootPath(appDir),
159161
}
160162
if (buildFromSource) {
161163
options.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild"

0 commit comments

Comments
 (0)