You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-21Lines changed: 23 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,4 @@
1
-
💨 serverless-esbuild
2
-
==============
1
+
# 💨 serverless-esbuild
3
2
4
3
Serverless plugin for zero-config JavaScript and TypeScript code bundling using promising fast & furious [`esbuild`](https://github.com/evanw/esbuild) bundler and minifier
5
4
@@ -9,16 +8,15 @@ Serverless plugin for zero-config JavaScript and TypeScript code bundling using
* Zero-config: Works out of the box without the need to install any other compiler or plugins
16
-
* Supports ESNext syntax with transforming limitations (See *Note*)
17
-
* Supports `sls package`, `sls deploy` and `sls deploy function`
18
-
* Supports `sls invoke local`
19
-
* Integrates nicely with [`serverless-offline`](https://github.com/dherault/serverless-offline)
13
+
- Zero-config: Works out of the box without the need to install any other compiler or plugins
14
+
- Supports ESNext syntax with transforming limitations (See _Note_)
15
+
- Supports `sls package`, `sls deploy` and `sls deploy function`
16
+
- Supports `sls invoke local`
17
+
- Integrates nicely with [`serverless-offline`](https://github.com/dherault/serverless-offline)
20
18
21
-
*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.
19
+
_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.
22
20
23
21
## Install
24
22
@@ -55,7 +53,6 @@ See [example folder](example) for a minimal example.
55
53
56
54
All files from `package/include` will be included in the final build file. See [Exclude/Include](https://serverless.com/framework/docs/providers/aws/guide/packaging#exclude--include)
57
55
58
-
59
56
## Usage
60
57
61
58
### Automatic compilation
@@ -73,13 +70,13 @@ simulate AWS Lambda and AWS API Gateway locally.
73
70
74
71
Add the plugins to your `serverless.yml` file and make sure that `serverless-esbuild`
75
72
precedes `serverless-offline` as the order is important:
73
+
76
74
```yaml
77
-
plugins:
78
-
...
79
-
- serverless-esbuild
80
-
...
81
-
- serverless-offline
82
-
...
75
+
plugins: ...
76
+
- serverless-esbuild
77
+
...
78
+
- serverless-offline
79
+
...
83
80
```
84
81
85
82
Run `serverless offline` or `serverless offline start` to start the Lambda/API simulation.
@@ -109,11 +106,12 @@ Note: When overriding ignore pattern, remember to ignore `.build` directory to a
109
106
110
107
Configure your service the same as mentioned above, but additionally add the `serverless-dynamodb-local`
111
108
plugin as follows:
109
+
112
110
```yaml
113
-
plugins:
114
-
- serverless-esbuild
115
-
- serverless-dynamodb-local
116
-
- serverless-offline
111
+
plugins:
112
+
- serverless-esbuild
113
+
- serverless-dynamodb-local
114
+
- serverless-offline
117
115
```
118
116
119
117
Run `serverless offline start`.
@@ -136,4 +134,8 @@ Options are:
136
134
137
135
[Victor Korzunin](https://floydspace.github.io/)
138
136
139
-
Inspired by [serverless-plugin-typescript](https://github.com/prisma-labs/serverless-plugin-typescript)
137
+
## Contributors
138
+
139
+
[Loup Topalian](https://github.com/olup)
140
+
141
+
Inspired by [serverless-plugin-typescript](https://github.com/prisma-labs/serverless-plugin-typescript) and [serverless-webpack](https://github.com/serverless-heaven/serverless-webpack)
0 commit comments