Skip to content

Commit

Permalink
fix(esbuild): use es2017 target for output bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
floydspace committed May 24, 2020
1 parent 058e726 commit 0b3e6dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ Serverless plugin for zero-config JavaScript and TypeScript code bundling using
## Features

* Zero-config: Works out of the box without the need to install any other compiler or plugins
* Supports ES2015 syntax + features (`export`, `import`, `async`, `await`, `Promise`, ...)
* Supports ESNext syntax with transforming limitations (See *Note*)
* Supports `sls package`, `sls deploy` and `sls deploy function`
* Supports `sls invoke local`
* Integrates nicely with [`serverless-offline`](https://github.com/dherault/serverless-offline)

*Note*: The default JavaScript syntax target is set to [`ES2017`](https://node.green/#ES2017), so the final bundle will be supported by all [AWS Lambda Node.js runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). If you still using an old lambda runtime and have to respect it you can play with esbuild `target` option, see [JavaScript syntax support](https://github.com/evanw/esbuild#javascript-syntax-support) for more details about syntax transform limitations.

## Install

```sh
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class EsbuildPlugin implements Plugin {
const concatUniq = compose(uniq, concat as (l1: BuildOptions[], l2: BuildOptions[]) => BuildOptions[]);
const withDefaultOptions = mergeWith(concatUniq, {
bundle: true,
target: 'es2017',
external: ['aws-sdk'],
});

Expand Down

0 comments on commit 0b3e6dd

Please sign in to comment.