Update build step
This commit is contained in:
Vendored
+3
-9
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
Vendored
+20
-6
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+20
-6
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user