feat: support custom esbuild module path #220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #218
This feature is required to unblock users of non-TypeScript languages. It can also be used to set different versions of esbuild for each Construct.
Custom path can be set on
CodeProps
andTransformerProps
per instance:Alternatively, the path can be set globally using the
CDK_ESBUILD_MODULE_PATH
environment variable:In TypeScript, the property defaults to
'esbuild'
.All other languages will use an automatic "best effort" resolution mechanism. The exact algorithm for this is considered an implementation detail and will change in future as new heuristics are added. Specifically, the package might be installed dynamically to a temporary location. To opt-out of this behavior, set
esbuildModulePath
prop orCDK_ESBUILD_MODULE_PATH
env variable.Python, Go, .NET and Java should use an absolute path, because the jsii execution environment uses a temporary working directory.