Skip to content

Commit 613dec9

Browse files
committed
build: src-node will be directly used from phoenix repo when development not needing rebuild on node changes
1 parent d0b11bc commit 613dec9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src-build/serveForPlatform.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {getPlatformDetails} from "./utils.js";
22
import {execa} from "execa";
33
import chalk from "chalk";
4+
import {resolve} from "path";
45

56
const {platform} = getPlatformDetails();
67

@@ -44,14 +45,18 @@ console.log(`Platform: ${platform}, target: ${target}`);
4445
console.log('\nEnsure to start phoenix server at http://localhost:8000 for development.');
4546
console.log('Follow https://github.com/phcode-dev/phoenix#running-phoenix for instructions.\n');
4647

47-
console.log('Setting up src-node...');
48-
await execa("npm", ["run", "_make_src-node"], {stdio: "inherit"});
49-
5048
// Run platform-specific command
5149
if (target === "tauri") {
50+
console.log('Setting up src-node...');
51+
await execa("npm", ["run", "_make_src-node"], {stdio: "inherit"});
52+
5253
console.log('Starting Tauri dev server...');
5354
await execa("npx", ["tauri", "dev"], {stdio: "inherit"});
5455
} else {
56+
const srcNodePath = resolve("../phoenix/src-node");
57+
console.log(`Running "npm ci" in ${srcNodePath}`);
58+
await execa("npm", ["ci"], {cwd: srcNodePath, stdio: "inherit"});
59+
5560
console.log('Starting Electron...');
5661
await execa("./src-electron/node_modules/.bin/electron", ["src-electron/main.js"], {stdio: "inherit"});
5762
}

0 commit comments

Comments
 (0)