/** * Disposes the hydration and SSR esbuild contexts, releasing the incremental * build state esbuild keeps in memory for them. The bundlers re-create the * contexts on their next run. */ export default async function disposeBundlerContexts() { try { await global.BUNEXT_BUNDLER_CTX?.dispose(); } catch (error) { } global.BUNEXT_BUNDLER_CTX = undefined; try { await global.BUNEXT_SSR_BUNDLER_CTX?.dispose(); } catch (error) { } global.BUNEXT_SSR_BUNDLER_CTX = undefined; }