Open henhal opened 3 years ago
I had similar issue with webpack 4 - switching to webpack 5 solved it.
@henhal can you try switching to webpack 5?
@j0k3r I tried to install webpack 5 in my own module using serverless-bundle, but it still used webpack 4. The serverless-webpack module properly uses peerDependencies for webpack, but serverless-bundle does not - it requires webpack ^4. Not sure if there's any way to try using webpack 5 without forking serverless-bundle, I'll try that.
This is a Feature Request
Description
AWS is deprecating Node 10 in April, so we've converted all our lambdas, and we then went straight to Node 14. Node 14 enables using some new features, so while at it I updated my
tsconfig.json
to transpile toES2020
instead ofES2019
:When doing so,
serverless-bundle
failed to deploy my lambdas, supposedly becauseserverless-webpack
does not support ES2020:Now, obviously I can run Node 14 with TS transpiled down to
ES2019
; since I use TS I get the nice new features anyway so to speak and it's not really critical what level the transpiled code has as long as it still works on Node 14 (whichES2019
obviously will). But I would guess that with AWS deprecating Node 12 and encouraging people to useES2020
features available in Node 14, you might be tempted to by default usetsconfig.json
files withES2020
level, and this will fail withserverless-webpack
.In my case, it was both my module containing the lambda and an external library which failed, so I have to go change the
tsconfig.json
also in the external library. Had I not owned that library as well, I might have been in greater trouble. So, assuming developers might start publishing libraries where the dist uses ES2020 features, this will be a severe problem for serverless-webpack?Additional Data