Detalhes do pacote

@mrgrain/cdk-esbuild

mrgrain87.3kMIT5.5.3

CDK constructs for esbuild, an extremely fast JavaScript bundler

aws-cdk, bundler, cdk, constructs

readme (leia-me)

<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mrgrain/cdk-esbuild/main/images/wordmark-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/mrgrain/cdk-esbuild/main/images/wordmark-light.svg"> cdk-esbuild </picture>

CDK constructs for esbuild, an extremely fast JavaScript bundler

Getting started | Documentation | API Reference | Python, .NET, & Go | FAQ

View on Construct Hub

Why?

esbuild is an extremely fast bundler and minifier for TypeScript and JavaScript. This package makes esbuild available to deploy AWS Lambda Functions, static websites or publish assets for further usage.

AWS CDK supports esbuild for AWS Lambda Functions, but the implementation cannot be used with other Constructs and doesn't expose all of esbuild's API.

Getting started

Install cdk-esbuild for Node.js using your favorite package manager:

# npm 
npm install @mrgrain/cdk-esbuild@5
# Yarn
yarn add @mrgrain/cdk-esbuild@5
# pnpm
pnpm add @mrgrain/cdk-esbuild@5

For Python, .NET or Go, use these commands:

# Python
pip install mrgrain.cdk-esbuild

# .NET
dotnet add package Mrgrain.CdkEsbuild

# Go
go get github.com/mrgrain/cdk-esbuild-go/cdkesbuild/v5

AWS Lambda: Serverless function

💡 See Lambda (TypeScript) and Lambda (Python) for working examples of a how to deploy an AWS Lambda Function.

Use TypeScriptCode as the code of a lambda function:

const bundledCode = new TypeScriptCode("src/handler.ts");

const fn = new lambda.Function(stack, "MyFunction", {
  runtime: lambda.Runtime.NODEJS_18_X,
  handler: "index.handler",
  code: bundledCode,
});

AWS S3: Static Website

💡 See React App (TypeScript) for a working example of a how to deploy a React app to S3.

Use TypeScriptSource as one of the sources of a static website deployment:

const websiteBundle = new TypeScriptSource("src/index.tsx");

const websiteBucket = new s3.Bucket(stack, "WebsiteBucket", {
  autoDeleteObjects: true,
  publicReadAccess: true,
  removalPolicy: cdk.RemovalPolicy.DESTROY,
  websiteIndexDocument: "index.html",
});

new s3deploy.BucketDeployment(stack, "DeployWebsite", {
  destinationBucket: websiteBucket,
  sources: [websiteBundle],
});

Amazon CloudWatch Synthetics: Canary monitoring

💡 See Monitored Website (TypeScript) for a working example of a deployed and monitored website.

Synthetics runs a canary to produce traffic to an application for monitoring purposes. Use TypeScriptCode as the code of a Canary test:

const bundledCode = new TypeScriptCode("src/canary.ts", {
  buildOptions: {
    outdir: "nodejs/node_modules", // This is required by AWS Synthetics
  },
});

const canary = new synthetics.Canary(stack, "MyCanary", {
  runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_5_1,
  test: synthetics.Test.custom({
    code: bundledCode,
    handler: "index.handler",
  }),
});

Documentation

The package exports constructs for use with AWS CDK features. The guiding design principal of this package is "extend, don't replace". Expect constructs that you can provide as props, not complete replacements.

For use with Lambda Functions and Synthetic Canaries, implementing lambda.Code (reference) and synthetics.Code (reference):

  • TypeScriptCode

Inline code is only supported by Lambda:

  • InlineTypeScriptCode

For use with S3 bucket deployments, implementing s3deploy.ISource (reference):

  • TypeScriptSource

Code and Source constructs seamlessly plug-in to other high-level CDK constructs. They share the same set of parameters, props and build options.

The following classes power the other features. You normally won't have to use them, but they are there if you need them:

  • TypeScriptAsset implements s3.Asset (reference) \ creates an asset uploaded to S3 which can be referenced by other constructs

  • EsbuildBundler implements core.BundlingOptions (reference) \ provides an interface for a esbuild bundler wherever needed

  • EsbuildProvider implements IBuildProvider and ITransformProvider \ provides the default esbuild API implementation and can be replaced with a custom implementation

API Reference

Auto-generated reference for Constructs, Classes and Structs. This information is also available as part of your IDE's code completion.

Python, .NET, Go

Esbuild requires a platform and architecture specific binary and currently has to be installed with a Node.js package manager like npm.

When using cdk-esbuild with Python, .NET or Go, the package will automatically detect local and global installations of the esbuild npm package. If none can be found, it will fall back to dynamically installing a copy into a temporary location. The exact algorithm of this mechanism must be treated as an implementation detail and should not be relied on. It can however be configured to a certain extent. See the examples below for more details.

This "best effort" approach makes it easy to get started. But is not always desirable, for example in environments with limited network access or when guaranteed repeatability of builds is a concern. You have several options to opt-out of this behavior.

Provide a controlled installation of esbuild

The first step is to install a version of esbuild that is controlled by you.

I strongly recommend to install esbuild as a local package. The easiest approach is to manage an additional Node.js project at the root of your AWS CDK project. esbuild can then be added to the package.json file and it is your responsibility to ensure required setup steps are taken in all environments like development machines and CI/CD systems.

Instead of installing the esbuild package in a local project, it can also be installed globally with npm install -g esbuild or a similar command. This approach might be preferred if a build container is prepared ahead of time, thus avoiding repeated package installation.

Change the automatic package detection

The second step is to make cdk-esbuild aware of your chosen install location. This step is optional, but it's a good idea to have the location or at least the method explicitly defined.

To do this, you can set the esbuildModulePath prop on a EsbuildProvider. Either pass a known, absolute or relative path as value, or use the EsbuildSource helper to set the detection method. Please refer to the EsbuildSource reference for a complete list of available methods.

// Use the standard Node.js algorithm to detect a locally installed package
new EsbuildProvider({
  esbuildModulePath: EsbuildSource.nodeJs(),
});

// Provide an explicit path
new EsbuildProvider({
  esbuildModulePath: '/home/user/node_modules/esbuild/lib/main.js',
});

As a no-code approach, the CDK_ESBUILD_MODULE_PATH environment variable can be set in the same way. An advantage of this is that the path can easily be changed for different systems. Setting the env variable can be used with any installation approach, but is typically paired with a global installation of the esbuild package. Note that esbuildModulePath takes precedence.

Override the default detection method

For an AWS CDK app with many instances of TypeScriptCode etc. it would be annoying to change the above for every single one of them. Luckily, the default can be changed for all usages per app:

const customModule = new EsbuildProvider({
  esbuildModulePath: EsbuildSource.globalPaths(),
});
EsbuildProvider.overrideDefaultProvider(customModule);

Customizing the Esbuild API

This package uses the esbuild JavaScript API. In most situations the default API configuration will be suitable. But sometimes it is required to configure esbuild differently or even provide a custom implementation. Common reasons for this are:

  • Using a pre-installed version of esbuild with Python, .NET or Go
  • If features not supported by the synchronous API are required, e.g. support for plugins
  • If the default version constraints for esbuild are not suitable
  • To use a version of esbuild that is installed by any other means than npm, including Docker

For these scenarios, this package offers customization options and an interface to provide a custom implementation:

declare const myCustomBuildProvider: IBuildProvider;

new TypeScriptCode("src/handler.ts", {
  buildProvider: myCustomBuildProvider,
});


declare const myCustomTransformProvider: ITransformProvider;

new InlineTypeScriptCode("let x: number = 1", {
  transformProvider: myCustomTransformProvider,
});

Esbuild binary path

It is possible to override the binary used by esbuild by setting a property on EsbuildProvider. This is the same as setting the ESBUILD_BINARY_PATH environment variable. Defining the esbuildBinaryPath prop takes precedence.

const buildProvider = new EsbuildProvider({
  esbuildBinaryPath: "path/to/esbuild/binary",
});

// This will use a different esbuild binary
new TypeScriptCode("src/handler.ts", { buildProvider });

Esbuild module path

The Node.js module discovery algorithm will normally be used to find the esbuild package. It can be useful to use specify a different module path, for example if a globally installed package should be used instead of a local version.

const buildProvider = new EsbuildProvider({
  esbuildModulePath: "/home/user/node_modules/esbuild/lib/main.js",
});

// This will use a different esbuild module
new TypeScriptCode("src/handler.ts", { buildProvider });

Alternatively supported by setting the CDK_ESBUILD_MODULE_PATH environment variable, which will apply to all uses. Defining the esbuildModulePath prop takes precedence.

If you are a Python, .NET or Go user, refer to the language specific guide for a more detailed explanation of this feature.

Custom Build and Transform API implementations

💡 See esbuild plugins w/ TypeScript for a working example of a custom Build API implementation.

A custom implementation can be provided by implementing IBuildProvider or ITransformProvider:

class CustomEsbuild implements IBuildProvider, ITransformProvider {
    buildSync(options: BuildOptions): void {
      // custom implementation goes here
    }

    transformSync(code: string, options?: TransformOptions): string {
      // custom implementation goes here, return transformed code
      return 'transformed code';
    }
}

// These will use the custom implementation
new TypeScriptCode("src/handler.ts", {
  buildProvider: new CustomEsbuild(),
});
new InlineTypeScriptCode("let x: number = 1", {
  transformProvider: new CustomEsbuild(),
});

Instead of esbuild, the custom methods will be invoked with all computed options. Custom implementations can amend, change or discard any of the options.

The IBuildProvider integration with CDK relies on the outdir/outfile values and it's usually required to use them unchanged.

ITransformProvider must return the transformed code as a string.

Failures and warnings should be printed to stderr and thrown as the respective esbuild error.

Overriding the default implementation providers

The default implementation can also be set for all usages of TypeScriptCode etc. in an AWS CDK app. You can change the default for both APIs at once or set a different implementation for each of them.

const myCustomEsbuildProvider = new MyCustomEsbuildProvider();

EsbuildProvider.overrideDefaultProvider(myCustomEsbuildProvider);
EsbuildProvider.overrideDefaultBuildProvider(myCustomEsbuildProvider);
EsbuildProvider.overrideDefaultTransformationProvider(myCustomEsbuildProvider);

// This will use the custom provider without the need to define it as a prop
new TypeScriptCode("src/handler.ts");

Roadmap & Contributions

The project's roadmap is available on GitHub.

Please submit feature requests as issues to the repository. All contributions are welcome, no matter if they are for already planned or completely new features.

FAQ

Should I use this package in production?

This package is stable and ready to be used in production, as many do. However esbuild has not yet released a version 1.0.0 and its API is still in active development. Please read the guide on esbuild's production readiness.

Note that esbuild minor version upgrades are also introduced in minor versions of this package. Since esbuild is pre v1, these versions typically introduce breaking changes and this package will inherit them. To avoid this behavior, add the desired esbuild version as a dependency to your package.

How do I upgrade from cdk-esbuild v4?

Please refer to the v5 release notes for a list of backwards incompatible changes and respective upgrade instructions.

[TS/JS] Why am I getting the error Cannot find module 'esbuild'?

This package depends on esbuild as an optional dependencies. If optional dependencies are not installed automatically on your system (e.g. when using npm v4-6), install esbuild explicitly:

npm install esbuild

[TS/JS] How can I use a different version of esbuild?

Use the override instructions for your package manager to force a specific version, for example:

{
  "overrides": {
    "esbuild": "0.14.7"
  }
}

Build and Transform interfaces are relatively stable across esbuild versions. However if any incompatibilities occur, buildOptions / transformOptions can be cast to any:

const bundledCode = new TypeScriptCode("src/handler.ts", {
  buildOptions: {
    unsupportedOption: "value"
  } as any,
});

[Python/.NET/Go] How can I use a different version of esbuild?

Install the desired version of esbuild locally or globally as described in the documentation above.

Build and Transform interfaces are relatively stable across esbuild versions. However if any incompatibilities occur, use the appropriate language features to cast any incompatible buildOptions / transformOptions to the correct types.

Can I use this package in my published AWS CDK Construct?

It is possible to use cdk-esbuild in a published AWS CDK Construct library, but not recommended. Always prefer to ship a compiled .js file or even bundle a zip archive in your package. For AWS Lambda Functions, projen provides an excellent solution.

If you do end up consuming cdk-esbuild, you will have to set buildOptions.absWorkingDir. The easiest way to do this, is to resolve the path based on the directory name of the calling file:

// file: node_modules/construct-library/src/index.ts
const props = {
  buildOptions: {
    absWorkingDir: path.resolve(__dirname, ".."),
    // now: /user/local-app/node_modules/construct-library
  },
};

This will dynamically resolve to the correct path, wherever the package is installed. Please open an issue if you encounter any difficulties.

Can I use this package with AWS CDK v1?

Yes, v2 of cdk-esbuild is compatible with AWS CDK v1. You can find the documentation for it on the v2 branch.

Support for AWS CDK v1 and cdk-esbuild v2 has ended on June 1, 2023. Both packages are not receiving any updates or bug fixes, including for security related issues. You are strongly advised to upgrade to a supported version of these packages.

changelog (log de mudanças)

5.5.3 (2025-06-15)

5.5.2 (2025-06-01)

5.5.1 (2025-05-28)

Bug Fixes

5.5.0 (2025-05-20)

Features

5.4.1 (2025-05-15)

5.4.0 (2025-05-05)

Features

5.3.10 (2025-04-01)

5.3.9 (2025-03-15)

5.3.8 (2025-03-01)

5.3.7 (2025-02-15)

5.3.6 (2025-02-01)

5.3.5 (2025-01-15)

5.3.4 (2025-01-01)

5.3.3 (2024-12-15)

5.3.2 (2024-12-01)

5.3.1 (2024-11-15)

5.3.0 (2024-11-09)

Features

5.2.10 (2024-11-09)

5.2.9 (2024-11-02)

5.2.8 (2024-09-15)

5.2.7 (2024-09-01)

5.2.6 (2024-08-15)

5.2.5 (2024-08-01)

5.2.4 (2024-07-15)

5.2.3 (2024-07-01)

5.2.2 (2024-06-15)

5.2.1 (2024-06-01)

5.2.0 (2024-05-25)

Features

5.1.0 (2024-05-01)

Features

Bug Fixes

5.0.16 (2024-04-15)

5.0.15 (2024-04-01)

5.0.14 (2024-03-15)

5.0.13 (2024-03-01)

5.0.12 (2024-02-15)

5.0.11 (2024-02-01)

5.0.10 (2024-01-15)

5.0.9 (2024-01-01)

Bug Fixes

  • cannot have multiple TypeScriptCode in the same scope (#1020) (149b36c), closes #1016

5.0.8 (2023-12-24)

Bug Fixes

5.0.7 (2023-12-15)

5.0.6 (2023-12-01)

5.0.5 (2023-11-15)

5.0.4 (2023-11-01)

5.0.3 (2023-10-15)

5.0.2 (2023-10-01)

5.0.1 (2023-09-15)

5.0.0-rc.0 (2023-09-09)

⚠ BREAKING CHANGES

  • TsConfigOptions renamed to TsconfigRaw which is the name esbuild uses.
  • The JavaScript versions of all classes have been removed. They have been functionally identical to the TypeScript versions since the beginning. Please use the TypeScript versions of the classes going forward.
  • Low-level experimental classes EsbuildAsset and EsbuildCode have been removed. Please use TypeScriptAsset and TypeScriptCode respectively.
  • The required minimum version of aws-cdk-lib is now 2.51.0. If you need to use an older version of aws-cdk-lib, please stay on v4.
  • Support for node14 and node16 has been dropped. If you need to use one of these versions, please use @mrgrain/cdk-esbuild@v4

Features

4.2.3 (2023-09-01)

4.2.2 (2023-08-15)

4.2.1 (2023-08-01)

4.2.0 (2023-07-26)

Features

4.1.13 (2023-07-26)

4.1.12 (2023-07-26)

4.1.11 (2023-07-15)

4.1.10 (2023-07-01)

4.1.9 (2023-06-15)

4.1.8 (2023-05-15)

4.1.7 (2023-05-01)

4.1.6 (2023-04-15)

4.1.5 (2023-04-01)

4.1.4 (2023-03-15)

4.1.3 (2023-03-01)

4.1.2 (2023-02-15)

4.1.1 (2023-01-30)

4.1.0 (2023-01-14)

Features

4.0.0 (2023-01-09)

⚠ BREAKING CHANGES

  • New minimal version requirement of aws-cdk-lib >= 2.12.0. Versions before that depend on vulnerable packages and should not be used anymore. Please upgrade to a more recent version of aws-cdk-lib.
  • New unified provider interface to replace buildFn, transformFn, esbuildBinaryPath and esbuildModulePath. Please configure the included EsbuildProvider for more options or provide a custom implementation as an escape hatch to buildProvider and transformProvider respectively.
  • props.copyDir now removes the destination directory and any containing files if it exists. This will only affect edge cases when an asset has already been bundled and re-bundling is forced. Previously the destination directory would not have been cleared out, leading to outdated files being included in the bundle or an error message in same cases. The previous behavior was not correct and cannot be restored.
  • The default format and platform InlineXCode classes has been changed to csj and node. If you are using these classes to create browser or ESM compatible code, please update format and platform on props.transformOptions to the required values.
  • Removal of InlineJsxCode and InlineTsxCode classes. Use InlineJavaScriptCode or InlineTypeScriptCode respectively and set transformOptions.loader to jsx or tsx.
  • InlineJavaScriptCode and InlineTypeScriptCode now only take TransformerProps as second argument. Please provide any transform options via props.transformOptions. Previously TransformOptions could be provided at the top-level.

Features

  • InlineJavaScriptCode and InlineTypeScriptCode transform to CommonJS and Node by default (#282) (37736a7)
  • graduate InlineJavaScriptCode and InlineTypeScriptCode to stable (#283) (be31a04)
  • new IBuildProvider and ITransformProvider to unify esbuild provider options (#286) (f60ab8e)
  • publish for go (#341) (66a0df0)
  • support overriding the default esbuild API implementations (#313) (eee3443)

Bug Fixes

  • use shorter package name for go (#342) (2026131)
  • remove deprecated support of top-level TransformOptions on InlineCode classes (#281) (7159ef9)
  • upgrade minium version requirement for aws-cdk-lib (#315) (86096f7)

3.13.0 (2022-12-18)

Features

3.11.6 (2022-12-17)

3.11.5 (2022-12-03)

3.11.4 (2022-11-05)

3.11.3 (2022-10-29)

Bug Fixes

3.11.2 (2022-08-24)

Bug Fixes

  • esbuild discovery can't find module installed in project (#234) (58d7604), closes #233

3.11.1 (2022-08-22)

Bug Fixes

  • TransformOptions.tsconfigRaw cannot receive an object (#230) (1584ece)

3.11.0 (2022-08-20)

Features

  • auto install esbuild on jsii platforms (#226) (d97688a)

3.10.0 (2022-08-14)

Features

3.9.0 (2022-08-14)

Features

3.8.1 (2022-08-13)

Bug Fixes

  • remove console object overwrites from InlineCode (#214) (dde3fdf)

3.8.0 (2022-08-13)

Features

  • support new esbuild options: platform, jsxDev, jsxImportSource (#209) (a7d14e7)

Bug Fixes

  • esbuildBinaryPath not working with Code, not available for InlineCode (#210) (dc2609b), closes #203
  • esbuild messages printed out twice (#212) (2596368)

3.7.2 (2022-07-15)

Bug Fixes

  • only reset esbuild bin path if it was overwritten (#190) (59c3c80)

3.7.0 (2022-07-13)

Features

  • support absolute entry points, as long as they are within the working directory (0e56b44)

3.6.0 (2022-06-23)

Features

  • allow setting of esbuildBinaryPath via Construct interface (f4eeebe)
  • upgrade esbuild to support supported buildOption and new copy loader (3ac5d92)

Bug Fixes

  • make TypeScriptCode and JavaScriptCode correctly extend aws_lambda.Code in jsii (d04db27)

3.5.0 (2022-06-02)

Features

  • support logOverride buildOption (d1cad61)

3.4.0 (2022-05-26)

Features

  • copyDir supports more complex scenarios (08c59fb)

3.3.0 (2022-03-06)

Features

  • support mangleQuoted option (f4d8859)

3.2.0 (2022-02-04)

Features

  • support esbuild mangle-props (a2566d1)

3.1.0 (2022-01-28)

Features

  • support new build option drop from esbuild (54445ad)

Bug Fixes

  • replace mocked with version from jest-mock (2e9761d)
  • replace removed Node.js type (e58b268)

3.0.0 (2021-12-09)

Features

Bug Fixes

  • remove imports from aws-cdk-lib/core (68ee09a)

2.2.0 (2021-12-04)

This release contains an upgrade of esbuild with backwards-incompatible changes. This is inline with the versioning strategy for this package, which is to release esbuild upgrades with minor versions as long as esbuild has not reached version 1.0.0. The backwards-incompatible changes are fairly obscure this time around, but please make sure to read the 0.14.0 release notes.

Features

  • upgrade esbuild to ^0.14.0 (#143) (4568b92)
  • examples/esbuild-with-plugins: example of how to use the escape hatch to run esbuild with plugins (#142) (0876f0e)

2.1.0 (2021-11-25)

Features

  • escape hatch to provide a custom build or transform function (#141) (aacfac1)
  • Inline*Code now takes TransformerProps as second parameter, passing in TransformOptions is still supported but deprecated (#141) (aacfac1)

2.0.0 (2021-11-07)

⚠ BREAKING CHANGES

  • Major release of this package to make it JSII compatible (#114) (727c78a), closes #114 #117 #119 #120 #123

  • Deprecated features from v1 have been removed. Please see upgrading instructions below.

Upgrading to v2

  • Update the package dependency to v2: npm install --save @mrgrain/cdk-esbuild@^2.0.0
  • esbuild is now installed as an optional dependency. If your setup does not automatically install optional dependencies, add it as an explicit dependency.
  • Remove any use of bundlerPriority.
  • Unstable construct EsbuildBundling has been renamed to EsbuildBundler and its interface has slightly changed. Like most other constructs, it now takes entryPoints as first parameter, with an optional props object as the second.

Features

1.133.0 (2021-11-21)

  • This is a release on the legacy v1 branch. Please upgrade to v2 as soon as possible.
  • works with cdk-1.133.0

⛔ EXTREMELY IMPORTANT NOTICE FOR USERS WHO HAVE NOT UPGRADE TO v2 OF THIS PACKAGE

tl;dr No more "versioned" release on this legacy branch.

Until now, I have release a new version of this package every time a new CDK version was released. Even if no updates where necessary. This practice will stop with this release and I will only release a new version on the legacy v1 branch, if an update is required for compatibility. Please upgrade to v2 of this package as soon as possible!

Upgrading instructions to v2 of this package

If you're using the tag cdk-v1, you will already receive the latest stable v2 release. If you're using a versioned tag (e.g. cdk-1.29.0), this tag format is deprecated and release have not been tagged for a while now.

1.132.0 (2021-11-21)

  • works with cdk-1.132.0

⚠ IMPORTANT NOTICE

This is a release on the legacy v1 branch. Please upgrade to v2 as soon as possible.

If you're using the tag cdk-v1, you will already receive the latest stable v2 release. If you're using a versioned tag (e.g. cdk-1.29.0), this tag format is deprecated and future releases won't be tagged like this.

1.131.0 (2021-11-07)

  • works with cdk-1.131.0

⚠ IMPORTANT NOTICE

This is a release on the legacy v1 branch. Please upgrade to v2 as soon as possible.

If you're using the tag cdk-v1, you will already receive the latest stable v2 release. If you're using a versioned tag (e.g. cdk-1.29.0), this tag format is deprecated and future releases won't be tagged like this.

1.130.0 (2021-11-07)

  • works with cdk-1.130.0

⚠ IMPORTANT NOTICE

This is the first release on the legacy v1 branch. Please upgrade to v2 as soon as possible.

If you're using the tag cdk-v1, you will already receive the latest stable v2 release. If you're using a versioned tag (e.g. cdk-1.29.0), this tag format is deprecated and future releases won't be tagged like this.

1.129.0 (2021-10-28)

⚠ IMPORTANT NOTICE

This will be the final release tagged with a specific version of AWS CDK (i.e. cdk-1.29.0). From now on, a single tag cdk-v1 will point to the latest stable release for v1 of AWS CDK.

Please also note, that a new major version of this package already has a release candidate. Using the cdk-v1 will result in BREAKING CHANGES once the new version is stable.

Features

  • works with cdk-1.129.0 (d7631d4)
  • deprecated Docker bundler (6715463)

1.128.0 (2021-10-16)

  • works with cdk-1.128.0

1.127.0 (2021-10-09)

  • works with cdk-1.127.0
  • example/website: How to monitor a website with Synthetics (621d2d4)

1.126.0 (2021-10-09)

Features

  • works with cdk-1.126.0
  • [Experimental] Code is now compatible with @aws-cdk/aws-synthetics (#99) (f840300)

1.125.0 (2021-10-01)

⚠ BREAKING CHANGES

  • esbuild released a breaking change to the tree shaking options and introduced a new way how platform-specific binaries are installed. Please check the esbuild v0.13.0 release notes for details.

Features

  • works with cdk-1.125.0

  • upgrade esbuild minimum version to ^0.13.0 (3d0b5ee)

1.124.0 (2021-10-01)

  • works with cdk-1.124.0

1.123.0 (2021-09-22)

  • works with cdk-1.123.0

1.122.0 (2021-09-12)

  • works with cdk-1.122.0

1.121.0 (2021-09-12)

  • works with cdk-1.121.0

1.120.0 (2021-09-12)

  • works with cdk-1.120.0

1.119.0 (2021-09-12)

  • works with cdk-1.119.0

1.118.0 (2021-09-12)

  • works with cdk-1.118.0

Bug Fixes

  • fix error handling type issue in latest tsc version (b5e36e2)

1.117.0 (2021-08-08)

  • works with cdk-1.117.0

1.116.0 (2021-08-08)

  • works with cdk-1.116.0

1.115.0 (2021-08-08)

  • works with cdk-1.115.0

1.114.0 (2021-08-08)

  • works with cdk-1.114.0

1.113.0 (2021-08-08)

  • works with cdk-1.113.0

1.112.0 (2021-08-08)

  • works with cdk-1.112.0

1.111.0 (2021-08-08)

  • works with cdk-1.111.0

1.110.0 (2021-06-24)

  • works with cdk-1.110.0

1.109.0 (2021-06-24)

  • works with cdk-1.109.0

1.108.0 (2021-06-09)

  • works with cdk-1.108.0

1.107.0 (2021-06-03)

  • works with cdk-1.107.0

1.106.0 (2021-05-31)

  • works with cdk-1.106.0

1.105.0 (2021-05-19)

  • works with cdk-1.105.0

⚠️ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • upgraded esbuild to v0.12.0 which contains backwards-incompatible changes (mostly related to CSS bundling)

1.104.0 (2021-05-19)

1.103.0 (2021-05-13)

  • works with cdk-1.103.0

⚠️ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • removed deprecated forceDockerBundling and localBundling (cc40b90)

1.102.0 (2021-05-04)

Features

  • new high-level constructs prop bundlerPriority to replace deprecated forceDockerBundling (cc4c933)
  • examples/lambda: added new complete example for lambda function (f8ca3c0)

Bug Fixes

  • examples/website: changed start command to work with latest esbuild versions (45b4c91)

1.101.0 (2021-05-01)

  • works with cdk-1.101.0

Features

  • pretty print esbuild build errors and warnings when using local bundler (7f15bed)
  • pretty print esbuild transform errors and warnings (1eeeb10)
  • set bundling priority explicitly, deprecating localBundling in favour of priority (425665a)

1.100.0 (2021-05-01)

  • no changes, cdk version constraints are now less strict

1.99.0 (2021-04-19)

1.98.0 (2021-04-13)

1.97.0 (2021-04-11)

⚠️ BREAKING CHANGES TO EXPERIMENTAL FEATURES

Features

  • support object maps for entry points (62a4431)

1.96.0 (2021-04-11)

⚠️ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • removed deprecated projectRoot prop, please use buildOptions.absWorkingPath instead (40e7ab0)

1.95.0 (2021-03-28)

⚠️ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • exported TypeScriptAsset & JavaScriptAsset are now implementing s3.Asset and replace the previously deprecated aliases for code classes of the same name; replace any previous use with TypeScriptCode & JavaScriptCode for lambda functions (9b86eab)

Features

  • added various InlineCode constructs using the transform api (6ef1c97)
  • support added for outfile build option (90ef5ec)

1.94.1 (2021-03-17)

Bug Fixes

  • change cdk version constraints to work with patches (fa0fa5f)

1.94.0 (2021-03-16)

⚠️ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • deprecated TypeScriptAsset & JavaScriptAsset in favour of TypeScriptCode & JavaScriptCode (f31074e)
  • deprecated projectRoot in favour of buildOptions.absWorkDir (ef7ae23) \ Now absWorkDir will take priority, then projectRoot. If neither are provided it falls back to the current working directory, which is esbuild's default behaviour. \ The automatic project root detection has been removed.
  • upgraded esbuild dependency requirement to ^0.9.0 which contains breaking changes (f27d987)

Features

  • set sensible defaults for website deployment (a7a925d)
  • new copyDir prop to copy additional files into the output (1dccb25)
  • support for multiple entryPoints (e41757b)
  • bundleOptions.outdir can now be provided as an additional path prefix for rendered files in the auto-generated cdk output directory (9be0f62)

1.93.1 (2021-03-12)

Required release to make version available on npm.

1.93.0 (2021-03-12)

⚠️ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • projectRoot auto detection now searches upwards from the entry point, instead of current working directory
  • deprecated TypeScriptAsset & JavaScriptAsset in favour of TypeScriptCode & JavaScriptCode (f31074e)

Features

  • added implementation of S3 deployment source which can be used for static website deployment (f31074e)