Skip to content

Commit

Permalink
chore(build): enable dev server by default
Browse files Browse the repository at this point in the history
  • Loading branch information
skjsjhb committed Jan 1, 2025
1 parent 67433d0 commit fe3390f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
8 changes: 1 addition & 7 deletions build-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,7 @@ export async function build(variant: BuildVariant) {

consola.start("Starting Electron process...");
const electronExec = path.resolve(import.meta.dirname, "node_modules", "electron", "cli.js");
const proc = child_process.fork(electronExec, ["."], {
env: {
...process.env,
ALICORN_DEV_SERVER: "1"
},
cwd: outputDir
});
const proc = child_process.fork(electronExec, ["."], { cwd: outputDir });

process.once("SIGINT", () => {
consola.info("Closing Electron app...");
Expand Down
1 change: 0 additions & 1 deletion src/main/main-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
ALICORN_DEV_SERVER?: string;
ALICORN_CONFIG_PATH?: string;
ALICORN_STORE_PATH?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function main() {
console.log("Loading window contents...");

// Load renderer from dev server (dev) or file (prod).
if (import.meta.env.AL_DEV && process.env.ALICORN_DEV_SERVER) {
if (import.meta.env.AL_DEV) {
const devServerURL = `http://localhost:${import.meta.env.AL_DEV_SERVER_PORT}/`;
console.log(`Picked up dev server URL: ${devServerURL}`);
await mainWindow.loadURL(devServerURL);
Expand Down

0 comments on commit fe3390f

Please sign in to comment.