Skip to content

Commit

Permalink
Merge pull request #240 from floydspace/sls-peer-dep
Browse files Browse the repository at this point in the history
feat: set esbuild as a peer depedency
  • Loading branch information
floydspace authored Dec 6, 2021
2 parents 8a1dcc0 + fcadf51 commit 273a3a6
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 80 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ _Note_: The default JavaScript syntax target is determined from serverless provi
## Install

```sh
yarn add --dev serverless-esbuild
# install `serverless-esbuild` and `esbuild`
yarn add --dev serverless-esbuild esbuild
# or
npm install -D serverless-esbuild
npm install -D serverless-esbuild esbuild
# or
pnpm install -D serverless-esbuild
pnpm install -D serverless-esbuild esbuild
```

Add the following plugin to your `serverless.yml`:
Expand Down Expand Up @@ -93,7 +94,7 @@ One example is to pass `--legacy-peer-deps` to npm v7+, to use legacy `peerDepen
custom:
esbuild:
installExtraArgs: # optional. Default is empty (no arguments)
- "--legacy-peer-deps"
- '--legacy-peer-deps'
```

### Using esbuild plugins
Expand Down Expand Up @@ -149,7 +150,7 @@ custom:
nativeZip: true
```
**NOTE:*** This will produce non-deterministic archives which causes a Serverless deployment update on every deploy.
_NOTE_: This will produce non-deterministic archives which causes a Serverless deployment update on every deploy.
### Concurrency
Expand All @@ -161,7 +162,7 @@ custom:
concurrency: 10
```

**NOTE:*** This will produce slower builds.
_NOTE_: This will produce slower builds.

## Usage

Expand Down Expand Up @@ -261,7 +262,6 @@ These options belong under `custom.esbuild` in your `serverless.yml` or `serverl

Inspired by [serverless-plugin-typescript](https://github.com/prisma-labs/serverless-plugin-typescript) and [serverless-webpack](https://github.com/serverless-heaven/serverless-webpack)


## External tools

- [`serverless-analyze-bundle-plugin`](https://github.com/adriencaccia/serverless-analyze-bundle-plugin): a plugin that allow users to analyze the bundle of a lambda
162 changes: 90 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@types/serverless": "^1.78.25",
"@typescript-eslint/eslint-plugin": "^4.2.0",
"@typescript-eslint/parser": "^4.2.0",
"esbuild": "^0.14.2",
"eslint": "^7.9.0",
"husky": "^7.0.2",
"jest": "^26.4.2",
Expand All @@ -66,14 +67,16 @@
"archiver": "^5.3.0",
"bestzip": "^2.2.0",
"chokidar": "^3.4.3",
"esbuild": ">=0.8",
"fs-extra": "^9.0.1",
"globby": "^11.0.1",
"p-map": "^4.0.0",
"ramda": "^0.27.0",
"semver": "^7.3.5",
"string.prototype.matchall": "^4.0.4"
},
"peerDependencies": {
"esbuild": ">=0.8 <0.15"
},
"lint-staged": {
"*.ts": [
"prettier --write",
Expand Down

0 comments on commit 273a3a6

Please sign in to comment.