Skip to content

Commit ec2480d

Browse files
committed
Update electron forge packager config
1 parent afb2058 commit ec2480d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

forge.config.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ const config: ForgeConfig = {
2323
afterComplete: [
2424
(extractPath, electronVersion, platform, arch, done) => {
2525
// move node_modules/electron-serve to the app directory
26-
fs.moveSync(
27-
path.join(extractPath, "resources/electron-serve"),
28-
path.join(extractPath, "resources/app/node_modules/electron-serve"),
26+
const from = path.join(extractPath, "node_modules/electron-serve");
27+
const to = path.join(
28+
extractPath,
29+
"resources/app/node_modules/electron-serve",
2930
);
31+
if (fs.existsSync(from)) {
32+
fs.moveSync(
33+
path.join(extractPath, "resources/electron-serve"),
34+
path.join(extractPath, "resources/app/node_modules/electron-serve"),
35+
);
36+
}
3037
done();
3138
},
3239
],

0 commit comments

Comments
 (0)