Refactor start and dev commands. Start in child processes. Handle errors better
This commit is contained in:
+2
@@ -1,5 +1,6 @@
|
||||
import { log } from "../../utils/log";
|
||||
import allPagesESBuildContextBundler from "../bundler/all-pages-esbuild-context-bundler";
|
||||
import pagesSSRBundler from "../bundler/pages-ssr-bundler";
|
||||
import serverPostBuildFn from "./server-post-build-fn";
|
||||
import watcherEsbuildCTX from "./watcher-esbuild-ctx";
|
||||
export default async function fullRebuild(params) {
|
||||
@@ -14,6 +15,7 @@ export default async function fullRebuild(params) {
|
||||
global.BUNDLER_CTX = undefined;
|
||||
await global.SSR_BUNDLER_CTX?.dispose();
|
||||
global.SSR_BUNDLER_CTX = undefined;
|
||||
await pagesSSRBundler();
|
||||
allPagesESBuildContextBundler({
|
||||
post_build_fn: () => {
|
||||
serverPostBuildFn();
|
||||
|
||||
+5
-1
@@ -5,7 +5,7 @@ import fullRebuild from "./full-rebuild";
|
||||
import { AppData } from "../../data/app-data";
|
||||
import checkExcludedPatterns from "../../utils/check-excluded-patterns";
|
||||
import pagesSSRBundler from "../bundler/pages-ssr-bundler";
|
||||
const { ROOT_DIR } = grabDirNames();
|
||||
const { ROOT_DIR, BUNX_BUNDLER_ERROR_EXIT_FILE } = grabDirNames();
|
||||
export default async function watcherEsbuildCTX() {
|
||||
const pages_src_watcher = watch(ROOT_DIR, {
|
||||
recursive: true,
|
||||
@@ -13,6 +13,10 @@ export default async function watcherEsbuildCTX() {
|
||||
}, async (event, filename) => {
|
||||
if (!filename)
|
||||
return;
|
||||
if (existsSync(BUNX_BUNDLER_ERROR_EXIT_FILE)) {
|
||||
await fullRebuild();
|
||||
return;
|
||||
}
|
||||
if (filename.match(/^\.\w+/)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user