From 9ff57dd79297630ebef0193be82c565dcb3af1bc Mon Sep 17 00:00:00 2001 From: Matthias Pichler Date: Fri, 15 Jul 2022 06:41:43 +0000 Subject: [PATCH 1/2] fix: only reset esbuild bin path if it was overwritten --- src/bundler.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bundler.ts b/src/bundler.ts index 6c1ab659..88a62d15 100644 --- a/src/bundler.ts +++ b/src/bundler.ts @@ -195,7 +195,13 @@ export class EsbuildBundler { printBuildMessages(error as BuildFailure, { prefix: 'Build ' }); } - process.env.ESBUILD_BINARY_PATH = originalEsbuildBinaryPath; + /** + * only reset `ESBUILD_BINARY_PATH` if it was explicitly set via the construct props + * since `esbuild` itself sometimes sets it (eg. when running in yarn 2 plug&play) + */ + if (this.props.esbuildBinaryPath) { + process.env.ESBUILD_BINARY_PATH = originalEsbuildBinaryPath; + } return true; }, From b4ce20b818864b5d9a2d9b8537552187280bf7ec Mon Sep 17 00:00:00 2001 From: Matthias Pichler Date: Fri, 15 Jul 2022 11:38:31 +0200 Subject: [PATCH 2/2] fix: remove extra whitespace Co-authored-by: Momo Kornher --- src/bundler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundler.ts b/src/bundler.ts index 88a62d15..25762a9c 100644 --- a/src/bundler.ts +++ b/src/bundler.ts @@ -198,7 +198,7 @@ export class EsbuildBundler { /** * only reset `ESBUILD_BINARY_PATH` if it was explicitly set via the construct props * since `esbuild` itself sometimes sets it (eg. when running in yarn 2 plug&play) - */ + */ if (this.props.esbuildBinaryPath) { process.env.ESBUILD_BINARY_PATH = originalEsbuildBinaryPath; }