Fix build lags

This commit is contained in:
2026-10-02 14:48:38 +01:00
parent 17a5c3df01
commit 8fa5b64b48
38 changed files with 1390 additions and 1238 deletions
+8 -2
View File
@@ -3,7 +3,6 @@ import type { FileSystemRouter, Server } from "bun";
import { type DirNames } from "../utils/grab-dir-names";
import type { BuildContext } from "esbuild";
import grabConstants from "../utils/grab-constants";
import { type FSWatcher } from "fs";
/**
* # Declare Global Variables
*/
@@ -24,7 +23,7 @@ declare global {
[k: string]: BundlerCTXMap;
};
var BUNEXT_BUNDLER_REBUILDS: 0;
var BUNEXT_PAGES_SRC_WATCHER: FSWatcher | undefined;
var BUNEXT_PAGES_SRC_WATCHER: any;
var BUNEXT_CURRENT_VERSION: string | undefined;
var BUNEXT_PAGE_FILES: PageFiles[];
var BUNEXT_ROOT_FILE_UPDATED: boolean;
@@ -47,6 +46,13 @@ declare global {
var BUNEXT_BUILD_FAILED: boolean;
var BUNEXT_CONSTANTS: ReturnType<typeof grabConstants>;
var BUNEXT_MAIN_CTX_BUILD_STARTS: number;
/**
* Resolves when the one-time dev startup build (hydration + SSR for all
* pages) has completed. The dev server starts listening before this
* resolves; page requests await it so they never render against
* half-built modules.
*/
var BUNEXT_INITIAL_BUILD_PROMISE: Promise<void> | undefined;
}
type Params = {
build_only?: boolean;