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
{{ message }}
This repository was archived by the owner on Nov 13, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+5-30Lines changed: 5 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,8 +64,6 @@ export function handler(event) {
64
64
- babel & webpack caching
65
65
- node_modules are split into a single `vendor.js` file. Allowing you to debug your own code in AWS console most of the time
66
66
67
-
- ⚠️ the only configuration file from your project that we will read is `tsconfig.json`. Other files won't be used. If you need to reuse part of your babel configuration, please open an issue with details on your usecase.
68
-
69
67
## Why?
70
68
71
69
There's already a dedicated [aws-lambda-nodejs module for CDK](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html) but I had two major issues with it:
@@ -75,30 +73,11 @@ There's already a dedicated [aws-lambda-nodejs module for CDK](https://docs.aws.
75
73
76
74
I want to be clear: I respect a LOT the work of the CDK team, and especially [@jogold](https://github.com/jogold/), author of aws-lambda-nodejs) that helped me a lot into debugging performance issues and explaining to me how everything works.
77
75
78
-
## Roadmap
79
-
80
-
This is a list of features I thought could be interesting to users. If you need on of them, please contribute to the project.
81
-
82
-
-[ ] Test/Get feedback on TypeScript support
83
-
-[ ] Get feedback on monorepo support
84
-
-[ ] Allow passing webpack/babel options/a function that can update the full webpack configuration
85
-
-[ ] Allow native modules/passing externals, with option `nativeModules` or `externals`. They would have to be installed into a temp folder with `npm_config_arch` and `npm_config_platform` and aliased in webpack configuration/or considered as externals. Externals and nativeModules seems related options but may be completely different
86
-
-[ ] Use [jsii](https://github.com/aws/jsii) to build the construct for other languages
87
-
-[ ] Add tests
88
-
-[ ] (if current way buggy): force people to provide aliases instead of considering cwd as base node_module
89
-
-[ ] Allow usage without the need of `entry`: `new NodejsFunction(this, "slack-notifications-lambda");` that would mimic https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html#nodejs-function
90
-
-[ ]
91
-
-[x] Generate a bundle where entry is moved to /main.js
92
-
-[x] Allow using TypeScript
93
-
-[x] use webpack and babel cache
94
-
-[x] remove webpackconfig from bundle
95
-
-[x] pass runtime to babel target
96
-
-[x] cdk synth generates different builds even when the lambda code does not changes, issue?
97
-
-[x] Allow using babel, if you need preset-env
98
-
-[x] add babel preset env by default
99
-
-[ ]~add bundling timing information to output console~ note: this would pollute cdk synth
100
-
-[ ]~Ask CDK team if this could live under their repositories~ Better be just community based
101
-
-[ ] Other ideas? Open an issue
76
+
## Caveats
77
+
78
+
⚠️ the only configuration file from your project that we will read is `tsconfig.json` (not including compilerOptions, which are overwritten using https://www.npmjs.com/package/@tsconfig/node12).
79
+
80
+
Other files won't be used (example: .babelrc). If you need to reuse part of your babel configuration, please open an issue with details on your usecase so we can build the best API for how to do this.
102
81
103
82
## How to make changes and test locally
104
83
@@ -114,10 +93,6 @@ yarn link aws-lambda-nodejs-webpack
114
93
# cdk commands will now use your local aws-lambda-nodejs-webpack
115
94
```
116
95
117
-
## WTF happened to the rollup version?
118
-
119
-
In case you starred this project early on, it was previously using [rollup.js](https://rollupjs.org/) to build lambdas. After hitting roadblocks along the way, for example rollup cannot handle well circular dependencies well, I decided to stop trying to use rollup. Rollup is great to build libraries, but not so great to build web applications. And lambdas are closer to web applications bundling than libraries.
0 commit comments