Skip to content

Commit

Permalink
fix: only reset esbuild bin path if it was overwritten (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-pichler authored Jul 15, 2022
1 parent 31ef196 commit 59c3c80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down

0 comments on commit 59c3c80

Please sign in to comment.