Update init function

This commit is contained in:
2026-04-04 19:35:14 +01:00
parent 7dbd1f7e12
commit 48c25d2fb4
9 changed files with 15 additions and 20 deletions
-6
View File
@@ -25,12 +25,6 @@ export default function () {
await bunextInit();
// await allPagesBunBundler();
await allPagesESBuildContextBundler({
post_build_fn: serverPostBuildFn,
});
await startServer();
});
}
-5
View File
@@ -2,8 +2,6 @@ import { Command } from "commander";
import startServer from "../../functions/server/start-server";
import { log } from "../../utils/log";
import bunextInit from "../../functions/bunext-init";
import allPagesBunBundler from "../../functions/bundler/all-pages-bun-bundler";
import allPagesESBuildContextBundler from "../../functions/bundler/all-pages-esbuild-context-bundler";
export default function () {
return new Command("start")
@@ -14,9 +12,6 @@ export default function () {
await bunextInit();
// await allPagesBunBundler();
await allPagesESBuildContextBundler();
await startServer();
});
}
@@ -73,6 +73,7 @@ export default async function allPagesESBuildContextBundler(params?: Params) {
],
jsx: "automatic",
splitting: true,
treeShaking: true,
logLevel: "silent",
// logLevel: "silent",
// logLevel: dev ? "error" : "silent",
+6
View File
@@ -13,6 +13,8 @@ import { log } from "../utils/log";
import cron from "./server/cron";
import type { BuildContext } from "esbuild";
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
import allPagesESBuildContextBundler from "./bundler/all-pages-esbuild-context-bundler";
import serverPostBuildFn from "./server/server-post-build-fn";
/**
* # Declare Global Variables
@@ -60,8 +62,12 @@ export default async function bunextInit() {
const is_dev = isDevelopment();
if (is_dev) {
await allPagesESBuildContextBundler({
post_build_fn: serverPostBuildFn,
});
watcherEsbuildCTX();
} else {
await allPagesESBuildContextBundler();
cron();
}
}