Update build step

This commit is contained in:
2026-07-01 19:18:11 +01:00
parent 61a9d8d612
commit 817beacc7a
20 changed files with 139 additions and 62 deletions
+3 -9
View File
@@ -1,9 +1,8 @@
import { Command } from "commander";
import { log } from "../../utils/log";
import init from "../../functions/init";
import grabDirNames from "../../utils/grab-dir-names";
import { rmSync } from "fs";
import allPagesESBuildContextBundler from "../../functions/bundler/all-pages-esbuild-context-bundler";
import bunextInit from "../../functions/bunext-init";
const { HYDRATION_DST_DIR, BUNX_CWD_PAGES_REWRITE_DIR } = grabDirNames();
export default function () {
return new Command("build")
@@ -15,13 +14,8 @@ export default function () {
}
catch (error) { }
global.SKIPPED_BROWSER_MODULES = new Set();
// await rewritePagesModule();
await init();
log.banner();
log.build("Building Project ...");
// await allPagesBunBundler();
// await allPagesBundler();
await allPagesESBuildContextBundler();
await bunextInit({ build_only: true });
log.success("Modules Built Successfully!");
process.exit();
});
}
+20 -6
View File
@@ -35,13 +35,27 @@ async function dev() {
NODE_ENV: "development",
},
};
let dev_process = Bun.spawn(spawn_options);
retries++;
let dev_process;
try {
dev_process = Bun.spawn(spawn_options);
}
catch (error) {
console.error(`Failed to start dev process:`, error);
retries++;
timeout = setTimeout(() => {
retries = 0;
}, 10000);
return await dev();
}
const exited = await dev_process.exited;
if (exited) {
retries++;
timeout = setTimeout(() => {
retries = 0;
}, 10000);
return await dev();
}
timeout = setTimeout(() => {
retries = 0;
}, 10000);
const exited = await dev_process.exited;
if (exited) {
return await dev();
}
}
+20 -6
View File
@@ -34,13 +34,27 @@ async function start() {
NODE_ENV: "production",
},
};
let dev_process = Bun.spawn(spawn_options);
retries++;
let dev_process;
try {
dev_process = Bun.spawn(spawn_options);
}
catch (error) {
console.error(`Failed to start production process:`, error);
retries++;
timeout = setTimeout(() => {
retries = 0;
}, 10000);
return await start();
}
const exited = await dev_process.exited;
if (exited) {
retries++;
timeout = setTimeout(() => {
retries = 0;
}, 10000);
return await start();
}
timeout = setTimeout(() => {
retries = 0;
}, 10000);
const exited = await dev_process.exited;
if (exited) {
return await start();
}
}