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
serverless-bundle is a [Serverless Framework](https://www.serverless.com) plugin that optimally packages your ES6 or TypeScript Node.js Lambda functions with sensible defaults so you **don't have to maintain your own Webpack configs**. It uses the [serverless-webpack](https://www.github.com/serverless-heaven/serverless-webpack) plugin internally.
4
4
@@ -109,6 +109,7 @@ custom:
109
109
- isomorphic-webcrypto # They'll be included in the node_modules/, more below
110
110
forceExclude: # Don't include these in the package
111
111
- chrome-aws-lambda # Because it'll be provided through a Lambda Layer
112
+
excludeFiles: "**/*.test.ts" # Exclude files from Webpack that match the glob
112
113
fixPackages: # Include fixes for specific packages
113
114
- "formidable@1.x" # For ex, formidable@1.x doesn't work by default with Webpack
114
115
copyFiles: # Copy any additional files to the generated package
@@ -417,9 +418,9 @@ custom:
417
418
externals: all
418
419
```
419
420
420
-
### Externals vs forceExclude
421
+
### Externals vs forceExclude vs excludeFiles
421
422
422
-
The two options (`externals`and `forceExclude`) look similar but have some subtle differences. Let's look at them in detail:
423
+
The three options (`externals`, `forceExclude`, and `excludeFiles`) look similar but have some subtle differences. Let's look at them in detail:
423
424
424
425
- `externals`
425
426
@@ -429,6 +430,10 @@ The two options (`externals` and `forceExclude`) look similar but have some subt
429
430
430
431
These packages are available in the Lambda runtime. Either by default (in the case of `aws-sdk`) or through a Lambda layer that you might be using. So these are not included in the Lambda package. And they are also marked as `externals`. Meaning that packages that are in `forceExclude` are automatically added to the `externals` list as well. By default, `aws-sdk` is listed in the `forceExclude`.
431
432
433
+
- `excludeFiles`
434
+
435
+
These are a glob of files that can be excluded from the function resolution. This happens when you have multiple files that are in the same directory and Serverless Framework tries to use them as a function handler. For example, if you have a `index.js` and a `index.test.js` and your function is pointing to `index`, you'll get a warning saying, `WARNING: More than one matching handlers found for index. Using index.js`. To fix this, use `excludeFiles: **/*.test.js`.
436
+
432
437
## Support
433
438
434
439
- Open a [new issue](https://github.com/AnomalyInnovations/serverless-bundle/issues/new) if you've found a bug or have some suggestions.
@@ -462,10 +467,21 @@ To install locally in another project.
462
467
$ npm install /path/to/serverless-bundle
463
468
```
464
469
470
+
## Releases
471
+
472
+
1. Label the PRs with `breaking`, `enhancement`, `bug`, `documentation`, or `internal`
473
+
2. Merge the PRs
474
+
3. Generate changelog `npm run changelog`
475
+
4. Draft a new release with the changelog
476
+
5. Up the version based on the PR labels `npm version <major|minor|patch>`
477
+
6. Push the tag `git push origin <tag_name>`
478
+
7. Publish to npm `npm publish`
479
+
8. Update the tag in release and publish release notes
480
+
465
481
## Thanks
466
482
467
483
This plugin would not be possible without the amazing [serverless-webpack](https://github.com/serverless-heaven/serverless-webpack) plugin and the ideas and code from [Create React App](https://www.github.com/facebook/create-react-app).
468
484
469
485
---
470
486
471
-
This plugin is maintained by [Anomaly Innovations](https://anoma.ly); makers of [Seed](https://seed.run) and [Serverless Stack](https://serverless-stack.com).
487
+
This plugin is maintained by [Serverless Stack](https://serverless-stack.com).
0 commit comments