Fix memory leak in dev server
This commit is contained in:
Vendored
+4
@@ -8,6 +8,7 @@ import serverPostBuildFn from "./server/server-post-build-fn";
|
||||
import reactModulesBundler from "./bundler/react-modules-bundler";
|
||||
import grabConstants from "../utils/grab-constants";
|
||||
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
||||
import disposeBundlerContexts from "./bundler/dispose-bundler-contexts";
|
||||
import { readFileSync } from "fs";
|
||||
const dirNames = grabDirNames();
|
||||
const { PAGES_DIR, BUNDLER_CTX_MAP_JSON, SSR_BUNDLER_CTX_MAP_JSON } = dirNames;
|
||||
@@ -86,6 +87,9 @@ export default async function bunextInit(params) {
|
||||
else {
|
||||
log.build(`Building Modules ...`);
|
||||
await allPagesESBuildContextBundler({ start: true });
|
||||
// The server only needs the artifact maps; don't keep
|
||||
// esbuild's build state alive for the rest of the process.
|
||||
await disposeBundlerContexts();
|
||||
}
|
||||
cron();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user