localstack / aws-cdk-local

Thin wrapper script for using the AWS CDK CLI with LocalStack
Apache License 2.0
263 stars 17 forks source link

Adjust patches and cdklocal script for esbuild bundled package #60

Closed whummer closed 2 years ago

whummer commented 2 years ago

Adjust patches and cdklocal script for esbuild bundled package. Addresses https://github.com/localstack/aws-cdk-local/issues/59

The CDK build has recently (v2.14.0 and above) switched from a regular build with runtime dependencies to a packaged build using esbuild. More details here: https://github.com/aws/aws-cdk/pull/18667

This PR separates the patches from the code imports, splits up the patches into separate functions, and then passes the imported libs to the patch functions. This allows us to apply the patches to v2.14.0+, as well as use a fallback mechanism for older CDK versions.