-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6ddf9b
commit 3bfbc5f
Showing
1 changed file
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,51 @@ | ||
# todo | ||
# serverless-plugin-tree-shake | ||
|
||
- [ ] tree-shake handler code; | ||
- [ ] tests; | ||
Shake the file dependency tree and only include files needed. | ||
|
||
## install | ||
|
||
```bash | ||
yarn add --dev serverless-plugin-tree-shake | ||
``` | ||
|
||
```bash | ||
npm install --save-dev serverless-plugin-tree-shake | ||
``` | ||
|
||
## usage | ||
|
||
```yaml | ||
plugins: | ||
- serverless-plugin-tree-shake | ||
package: | ||
# no need to spend time doing excluding dev dependencies, given that | ||
# serverless-plugin-tree-shake does it already | ||
excludeDevDependencies: false | ||
``` | ||
|
||
##### typescript support | ||
|
||
This plugins supports typescript natively. It uses the installed typescript package, reads the appropriate config, and transpiles to js according to that config. You can see examples on the [`__fixtures__`](./test/__fixtures__) that start with `ts-`. | ||
|
||
##### individually | ||
|
||
This plugins supports bundling functions `individually`. Just use that option accordingly: | ||
|
||
```yaml | ||
package: | ||
individually: true | ||
excludeDevDependencies: false | ||
``` | ||
|
||
##### include and exclude | ||
|
||
You can use the `include` and `exclude` global, and per-function, configurations and it will include/exclude the especified files/patterns. | ||
|
||
## todo | ||
|
||
- [ ] tree shake handlers, not only the file tree | ||
- [ ] add benchmarks | ||
|
||
## license | ||
|
||
BSD-3-Clause |