mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 01:41:21 +00:00
fix(config): preserve captured environments across provider launches
This commit is contained in:
1 parent
ccdeda7a27
commit
3864c7d667
4 files changed
+141
-50
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { snapshotEnvironment } from "../../process/snapshotEnvironment.js";
|
||||
import { isAbsolute } from "node:path";
|
||||
import { z } from "zod";
|
||||
import type {
|
||||
@@ -78,10 +79,14 @@ export class NativeModuleResolver implements WebModuleResolutionPort {
|
||||
#closePromise: Promise<void> | undefined;
|
||||
#pendingCleanup: AnalysisCleanupLease | undefined;
|
||||
|
||||
readonly environment: Readonly<Record<string, string | undefined>>;
|
||||
|
||||
constructor(
|
||||
readonly environment: Readonly<Record<string, string | undefined>>,
|
||||
environment: Readonly<Record<string, string | undefined>>,
|
||||
readonly launcher: ModuleResolverLauncher = launch,
|
||||
) {}
|
||||
) {
|
||||
this.environment = snapshotEnvironment(environment);
|
||||
}
|
||||
|
||||
resolve(
|
||||
input: Parameters<WebModuleResolutionPort["resolve"]>[0],
|
||||
@@ -180,6 +185,7 @@ export class NativeModuleResolver implements WebModuleResolutionPort {
|
||||
const browser = await observe(() =>
|
||||
this.launcher({
|
||||
executablePath: executable,
|
||||
env: this.environment,
|
||||
headless: true,
|
||||
timeout: Math.max(1, deadline.remainingMs()),
|
||||
handleSIGINT: false,
|
||||
|
||||
Reference in new issue
Block a user