Skip to content

Commit 81c6bdf

Browse files
feat: handle available native deps when building on non-native platforms
Closes #842
1 parent 46b84c8 commit 81c6bdf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/packager.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,14 @@ export class Packager implements BuildInfo {
231231
if (this.devMetadata.build.npmRebuild === false) {
232232
log("Skip app dependencies rebuild because npmRebuild is set to false")
233233
}
234-
else if (platform.nodeName === process.platform) {
235-
const forceBuildFromSource = this.devMetadata.build.npmSkipBuildFromSource !== true
236-
await installDependencies(this.appDir, this.electronVersion, Arch[arch], forceBuildFromSource, (await statOrNull(path.join(this.appDir, "node_modules"))) == null ? "install" : "rebuild")
237-
}
238234
else {
239-
log("Skip app dependencies rebuild because platform is different")
235+
const forceBuildFromSource = this.devMetadata.build.npmSkipBuildFromSource !== true
236+
if (platform.nodeName !== process.platform && forceBuildFromSource) {
237+
log("Skip app dependencies rebuild because platform is different")
238+
}
239+
else {
240+
await installDependencies(this.appDir, this.electronVersion, Arch[arch], forceBuildFromSource, (await statOrNull(path.join(this.appDir, "node_modules"))) == null ? "install" : "rebuild")
241+
}
240242
}
241243
}
242244
else {

0 commit comments

Comments
 (0)